Class KeyValueLoader
- java.lang.Object
-
- com.couchbase.client.core.config.loader.BaseLoader
-
- com.couchbase.client.core.config.loader.KeyValueLoader
-
- All Implemented Interfaces:
Loader
public class KeyValueLoader extends BaseLoader
This loader is responsible for initially loading a configuration through the kv protocol.The main and primary mechanism to bootstrap a good configuration is through the kv protocol with a special command, since those connections need to be open anyways and it is more efficient at large scale than the cluster manager (who is the authority).
Note that this loader can fail (hence the
ClusterManagerLoader
as a backup), either because the current seed node does not have the data service enabled or it is a memcached bucket which does not support the special command.In 1.x this loader used to be called Carrier Loader (from CCCP "couchbase carrier config publication"), but the new name more accurately reflects from which service it is loading it rather than how.
- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description KeyValueLoader(Core core)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Mono<byte[]>
discoverConfig(NodeIdentifier seed, String bucket)
To be implemented by the actual child, performs the actual fetching of a config.-
Methods inherited from class com.couchbase.client.core.config.loader.BaseLoader
core, load
-
-
-
-
Constructor Detail
-
KeyValueLoader
public KeyValueLoader(Core core)
-
-
Method Detail
-
discoverConfig
protected Mono<byte[]> discoverConfig(NodeIdentifier seed, String bucket)
Description copied from class:BaseLoader
To be implemented by the actual child, performs the actual fetching of a config.- Specified by:
discoverConfig
in classBaseLoader
- Parameters:
seed
- the node from where to fetch it.bucket
- the name of the bucket to fetch from.- Returns:
- the encoded json version of the config if complete, an error otherwise.
-
-