@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.
|
Mono<Void> |
shutdown()
Permanently shuts down the refresher.
|
public KeyValueBucketRefresher(ConfigurationProvider provider, Core core)
protected Duration pollerInterval()
public Mono<Void> register(String name)
BucketRefresher
register
in interface BucketRefresher
name
- the name of the bucket.Mono
once complete.public Mono<Void> deregister(String name)
BucketRefresher
deregister
in interface BucketRefresher
name
- the name of the bucket.Mono
once complete.public void markTainted(String name)
BucketRefresher
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).
markTainted
in interface BucketRefresher
name
- the name of the bucket.public void markUntainted(String name)
BucketRefresher
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).
markUntainted
in interface BucketRefresher
name
- the name of the bucket.public Mono<Void> shutdown()
BucketRefresher
shutdown
in interface BucketRefresher
Mono
once complete.Copyright © 2020 Couchbase, Inc.. All rights reserved.