Class KeyValueBucketRefresher
- java.lang.Object
-
- com.couchbase.client.core.config.refresher.KeyValueBucketRefresher
-
- All Implemented Interfaces:
BucketRefresher
@Internal public class KeyValueBucketRefresher extends Object implements BucketRefresher
TheKeyValueBucketRefresher
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 Constructor Description KeyValueBucketRefresher(ConfigurationProvider provider, Core core)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Void>
deregister(String name)
Deregisters a bucket from refreshing (stopping the refresh).void
markTainted(String name)
Marks the bucket as tainted, which will change the behavior of the refresher.void
markUntainted(String name)
Marks the bucket as untainted, which will change the behavior of the refresher.protected Duration
pollerInterval()
Allows to override the default poller interval in tests to speed them up.Mono<Void>
register(String name)
Registers a bucket for refreshing.Set<String>
registered()
Returns the names of all registered buckets.Mono<Void>
shutdown()
Permanently shuts down the refresher.
-
-
-
Constructor Detail
-
KeyValueBucketRefresher
public KeyValueBucketRefresher(ConfigurationProvider provider, Core core)
-
-
Method Detail
-
pollerInterval
protected Duration pollerInterval()
Allows to override the default poller interval in tests to speed them up.- Returns:
- the poller interval as a duration.
-
register
public Mono<Void> register(String name)
Description copied from interface:BucketRefresher
Registers a bucket for refreshing.- Specified by:
register
in interfaceBucketRefresher
- Parameters:
name
- the name of the bucket.- Returns:
- a
Mono
once complete.
-
deregister
public Mono<Void> deregister(String name)
Description copied from interface:BucketRefresher
Deregisters a bucket from refreshing (stopping the refresh).- Specified by:
deregister
in interfaceBucketRefresher
- Parameters:
name
- the name of the bucket.- Returns:
- a
Mono
once complete.
-
markTainted
public void markTainted(String name)
Description copied from interface:BucketRefresher
Marks 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:
markTainted
in interfaceBucketRefresher
- Parameters:
name
- the name of the bucket.
-
markUntainted
public void markUntainted(String name)
Description copied from interface:BucketRefresher
Marks 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:
markUntainted
in interfaceBucketRefresher
- Parameters:
name
- the name of the bucket.
-
shutdown
public Mono<Void> shutdown()
Description copied from interface:BucketRefresher
Permanently shuts down the refresher.- Specified by:
shutdown
in interfaceBucketRefresher
- Returns:
- a
Mono
once complete.
-
registered
public Set<String> registered()
Description copied from interface:BucketRefresher
Returns the names of all registered buckets.- Specified by:
registered
in interfaceBucketRefresher
- Returns:
- all registered buckets.
-
-