public class CouchbaseConfig extends net.spy.memcached.compat.SpyObject implements Config
Config implementation that represents a "couchbase" bucket config.
This Config implementation is VBucket-aware and allows several
operations against a list of nodes and VBuckets. For "memcached" type
buckets, see the MemcacheConfig implementation.| Constructor and Description |
|---|
CouchbaseConfig(net.spy.memcached.HashAlgorithm hashAlgorithm,
int serversCount,
int replicasCount,
int vbucketsCount,
java.util.List<java.lang.String> servers,
java.util.List<VBucket> vbuckets,
java.util.List<java.net.URL> couchServers,
java.util.List<java.lang.String> restEndpoints,
boolean hasForwardMap) |
| Modifier and Type | Method and Description |
|---|---|
ConfigDifference |
compareTo(Config config)
Compares the given configuration with the current configuration
and calculates the differences.
|
int |
foundIncorrectMaster(int vbucket,
int wrongServer) |
ConfigType |
getConfigType() |
java.util.List<java.net.URL> |
getCouchServers() |
net.spy.memcached.HashAlgorithm |
getHashAlgorithm() |
int |
getMaster(int vbucketIndex) |
int |
getReplica(int vbucketIndex,
int replicaIndex) |
int |
getReplicasCount() |
java.util.List<java.lang.String> |
getRestEndpoints() |
java.lang.String |
getServer(int serverIndex) |
java.util.List<java.lang.String> |
getServers() |
int |
getServersCount() |
int |
getVbucketByKey(java.lang.String key) |
java.util.List<VBucket> |
getVbuckets() |
int |
getVbucketsCount() |
boolean |
isTainted()
If the current config is tainted and will most possibly be replaced soon
with a clean one.
|
boolean |
nodeHasActiveVBuckets(java.net.InetSocketAddress node)
Check if the given node has active VBuckets.
|
java.lang.String |
toString() |
public CouchbaseConfig(net.spy.memcached.HashAlgorithm hashAlgorithm,
int serversCount,
int replicasCount,
int vbucketsCount,
java.util.List<java.lang.String> servers,
java.util.List<VBucket> vbuckets,
java.util.List<java.net.URL> couchServers,
java.util.List<java.lang.String> restEndpoints,
boolean hasForwardMap)
public int getReplicasCount()
getReplicasCount in interface Configpublic int getVbucketsCount()
getVbucketsCount in interface Configpublic int getServersCount()
getServersCount in interface Configpublic java.lang.String getServer(int serverIndex)
public int getVbucketByKey(java.lang.String key)
getVbucketByKey in interface Configpublic int getReplica(int vbucketIndex,
int replicaIndex)
getReplica in interface Configpublic java.util.List<java.net.URL> getCouchServers()
getCouchServers in interface Configpublic int foundIncorrectMaster(int vbucket,
int wrongServer)
foundIncorrectMaster in interface Configpublic java.util.List<java.lang.String> getServers()
getServers in interface Configpublic java.util.List<VBucket> getVbuckets()
getVbuckets in interface Configpublic ConfigDifference compareTo(Config config)
public net.spy.memcached.HashAlgorithm getHashAlgorithm()
getHashAlgorithm in interface Configpublic java.util.List<java.lang.String> getRestEndpoints()
getRestEndpoints in interface Configpublic boolean nodeHasActiveVBuckets(java.net.InetSocketAddress node)
node - the node to verify.public ConfigType getConfigType()
getConfigType in interface Configpublic boolean isTainted()
Configpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.