Class KeyValueBucketRefresher
java.lang.Object
com.couchbase.client.core.config.refresher.KeyValueBucketRefresher
- All Implemented Interfaces:
BucketRefresher
The
KeyValueBucketRefresher keeps configs up-to-date through the KV service.
The KV refresher works by proactively polling for new configurations against all open, registered buckets. It tries to iterate through all available KV nodes so that even if one or more are not available we'll eventually are able to get a proper, good config to work with.
Once a config is retrieved it is sent to the config manager which then decides if it is going to apply or discard the config.
- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionderegister(String name) Deregisters a bucket from refreshing (stopping the refresh).voidmarkTainted(String name) Marks the bucket as tainted, which will change the behavior of the refresher.voidmarkUntainted(String name) Marks the bucket as untainted, which will change the behavior of the refresher.protected DurationAllows to override the default poller interval in tests to speed them up.Registers a bucket for refreshing.Returns the names of all registered buckets.shutdown()Permanently shuts down the refresher.
-
Constructor Details
-
KeyValueBucketRefresher
-
-
Method Details
-
pollerInterval
Allows to override the default poller interval in tests to speed them up.- Returns:
- the poller interval as a duration.
-
register
Description copied from interface:BucketRefresherRegisters a bucket for refreshing.- Specified by:
registerin interfaceBucketRefresher- Parameters:
name- the name of the bucket.- Returns:
- a
Monoonce complete.
-
deregister
Description copied from interface:BucketRefresherDeregisters a bucket from refreshing (stopping the refresh).- Specified by:
deregisterin interfaceBucketRefresher- Parameters:
name- the name of the bucket.- Returns:
- a
Monoonce complete.
-
markTainted
Description copied from interface:BucketRefresherMarks the bucket as tainted, which will change the behavior of the refresher.A config is marked as tainted during rebalance, which usually leads to shorter intervals of checking if a new configuration exists (depending of the refresher impl).
- Specified by:
markTaintedin interfaceBucketRefresher- Parameters:
name- the name of the bucket.
-
markUntainted
Description copied from interface:BucketRefresherMarks the bucket as untainted, which will change the behavior of the refresher.A config is marked as tainted during rebalance, which usually leads to shorter intervals of checking if a new configuration exists (depending of the refresher impl).
- Specified by:
markUntaintedin interfaceBucketRefresher- Parameters:
name- the name of the bucket.
-
shutdown
Description copied from interface:BucketRefresherPermanently shuts down the refresher.- Specified by:
shutdownin interfaceBucketRefresher- Returns:
- a
Monoonce complete.
-
registered
Description copied from interface:BucketRefresherReturns the names of all registered buckets.- Specified by:
registeredin interfaceBucketRefresher- Returns:
- all registered buckets.
-