@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 | Method and Description |
---|---|
boolean |
bucketConfigLoadInProgress()
Returns true if a bucket config load attempt is in progress.
|
Mono<Void> |
closeBucket(String name)
Initiates the bucket closing process.
|
CollectionMap |
collectionMap()
Returns the attached collection map.
|
boolean |
collectionMapRefreshInProgress()
Returns true if a collection map refresh is in progress.
|
ClusterConfig |
config()
Returns the current
ClusterConfig . |
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 |
refreshCollectionMap(String bucket,
boolean force)
Helper method to refresh the collection map for the given bucket.
|
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.
|
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)
name
- the name of the bucket.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 refreshCollectionMap(String bucket, boolean force)
bucket
- the name of the bucket.force
- if set, the provider must fetch a new one. otherwise it will only fetch one for the bucket if not
already present.boolean globalConfigLoadInProgress()
boolean bucketConfigLoadInProgress()
boolean collectionMapRefreshInProgress()
Copyright © 2020 Couchbase, Inc.. All rights reserved.