@Stability.Internal public interface ConfigurationProvider
ConfigurationProvider
is responsible for grabbing, converting and managing
bucket and cluster configurations.
This interface has been around since the 1.0 days, but it has been adapted to fit the 2.x types and process.
Modifier and Type | Field and Description |
---|---|
static long |
TRIGGERED_BY_CONFIG_CHANGE_NOTIFICATION
The value emitted by the
configChangeNotifications() feed. |
Modifier and Type | Method and Description |
---|---|
boolean |
bucketConfigLoadInProgress()
Returns true if a bucket config load attempt is in progress.
|
Mono<Void> |
closeBucket(String name,
boolean pushConfig)
Initiates the bucket closing process.
|
CollectionMap |
collectionMap()
Returns the attached collection map.
|
boolean |
collectionRefreshInProgress()
Returns true while a collection refresh is in progress at all.
|
boolean |
collectionRefreshInProgress(CollectionIdentifier identifier)
Returns true if a collection refresh is in progress for the given identifier.
|
ClusterConfig |
config()
Returns the current
ClusterConfig . |
Flux<Long> |
configChangeNotifications()
Returns a feed that emits -1L
whenever someone calls
signalConfigChanged() . |
Flux<ClusterConfig> |
configs()
This is a hot stream which when attached will return the current config as well as
all subsequent ones.
|
boolean |
globalConfigLoadInProgress()
Returns true if an initial global config load attempt is in progress.
|
Mono<Void> |
loadAndRefreshGlobalConfig()
Instructs the provider to try and load the global config, and then manage it.
|
Mono<Void> |
openBucket(String name)
Initiates the bucket opening process.
|
void |
proposeBucketConfig(ProposedBucketConfigContext ctx)
Allows to propose a bucket config to the provider from an external context.
|
void |
proposeGlobalConfig(ProposedGlobalConfigContext ctx)
Allows to propose a global config to the provider from an external context.
|
void |
refreshCollectionId(CollectionIdentifier identifier)
Helper method to refresh the collection map for the given collection.
|
default void |
republishCurrentConfig()
Shouldn't be necessary, but gives
InvalidStateWatchdog something to do. |
Flux<Set<SeedNode>> |
seedNodes()
Returns a stream of seed node sets sourced from the server's global config or bucket config.
|
Mono<Void> |
shutdown()
Shuts down the configuration provider and all its associated resources and timers.
|
void |
signalConfigChanged()
Signals to the config provider that the server sent a notification
that the cluster topology or bucket config changed.
|
void |
signalConfigRefreshFailed(ConfigRefreshFailure failure)
Signals to the config provider that certain types of config refreshes failed and action might need to be taken.
|
static final long TRIGGERED_BY_CONFIG_CHANGE_NOTIFICATION
configChangeNotifications()
feed.Flux<ClusterConfig> configs()
ClusterConfig config()
ClusterConfig
.Flux<Set<SeedNode>> seedNodes()
Only nodes running the KV service are present in the set.
This is a hot stream which when attached will return the current set of seed nodes as well as all subsequent sets. The returned Flux does not emit any items until the client has received at least one config from the server.
Mono<Void> openBucket(String name)
Note that when this mono completes, it does not mean that the process is completely finished yet, just that it has been initiated and no hard error has been found at the time.
name
- the name of the bucket to open.Mono<Void> closeBucket(String name, boolean pushConfig)
name
- the name of the bucket.pushConfig
- whether this should result in a config being pushed. Not needed during e.g. shutdown.Mono<Void> shutdown()
void proposeBucketConfig(ProposedBucketConfigContext ctx)
This method is usually only called when a "not my vbucket" response is received and the corresponding config is extracted. Do not call this method with arbitrary configs.
ctx
- the bucket config and surrounding context.void proposeGlobalConfig(ProposedGlobalConfigContext ctx)
ctx
- the context with the global config.Mono<Void> loadAndRefreshGlobalConfig()
CollectionMap collectionMap()
void refreshCollectionId(CollectionIdentifier identifier)
identifier
- the identifier to refresh.default void republishCurrentConfig()
InvalidStateWatchdog
something to do.boolean globalConfigLoadInProgress()
boolean bucketConfigLoadInProgress()
boolean collectionRefreshInProgress()
boolean collectionRefreshInProgress(CollectionIdentifier identifier)
identifier
- the collection identifier to check.void signalConfigRefreshFailed(ConfigRefreshFailure failure)
failure
- the type of config refresh failure.void signalConfigChanged()
Flux<Long> configChangeNotifications()
signalConfigChanged()
.Copyright © 2024 Couchbase, Inc.. All rights reserved.