@Stability.Internal public class KeyValueBucketRefresher extends Object implements BucketRefresher
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.
| Constructor and Description |
|---|
KeyValueBucketRefresher(ConfigurationProvider provider,
Core core) |
| Modifier and Type | Method and 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.
|
public KeyValueBucketRefresher(ConfigurationProvider provider, Core core)
protected Duration pollerInterval()
public Mono<Void> register(String name)
BucketRefresherregister in interface BucketRefreshername - the name of the bucket.Mono once complete.public Mono<Void> deregister(String name)
BucketRefresherderegister in interface BucketRefreshername - the name of the bucket.Mono once complete.public void markTainted(String name)
BucketRefresherA 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).
markTainted in interface BucketRefreshername - the name of the bucket.public void markUntainted(String name)
BucketRefresherA 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).
markUntainted in interface BucketRefreshername - the name of the bucket.public Mono<Void> shutdown()
BucketRefreshershutdown in interface BucketRefresherMono once complete.public Set<String> registered()
BucketRefresherregistered in interface BucketRefresherCopyright © 2024 Couchbase, Inc.. All rights reserved.