public class DefaultCouchbaseBucketConfig extends AbstractBucketConfig implements CouchbaseBucketConfig
Constructor and Description |
---|
DefaultCouchbaseBucketConfig(long rev,
String name,
String uri,
String streamingUri,
CouchbasePartitionInfo partitionInfo,
List<NodeInfo> nodeInfos,
List<PortInfo> portInfos)
Creates a new
CouchbaseBucketConfig . |
Modifier and Type | Method and Description |
---|---|
boolean |
hasPrimaryPartitionsOnNode(InetAddress hostname)
Checks if the given hostname has active primary partitions assigned to it.
|
NodeInfo |
nodeAtIndex(int nodeIndex)
Returns information for the node at the given index.
|
short |
nodeIndexForMaster(int partition)
Returns the node index for the given partition index and master.
|
short |
nodeIndexForReplica(int partition,
int replica)
Returns the node index for the given partition index and the replica.
|
int |
numberOfPartitions()
Returns the total number of partitions.
|
int |
numberOfReplicas()
The number of configured replicas for this bucket.
|
long |
rev()
Revision number (optional) for that configuration.
|
boolean |
tainted()
If a config is marked as tainted.
|
String |
toString() |
BucketType |
type()
The bucket type.
|
locator, name, nodes, password, password, serviceEnabled, streamingUri, uri
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
locator, name, nodes, password, password, serviceEnabled, streamingUri, uri
public DefaultCouchbaseBucketConfig(long rev, String name, String uri, String streamingUri, CouchbasePartitionInfo partitionInfo, List<NodeInfo> nodeInfos, List<PortInfo> portInfos)
Creates a new CouchbaseBucketConfig
.
rev
- the revision of the config.name
- the name of the bucket.uri
- the URI for this bucket.streamingUri
- the streaming URI for this bucket.partitionInfo
- partition info for this bucket.nodeInfos
- related node information.portInfos
- port info for the nodes, including services.public int numberOfReplicas()
CouchbaseBucketConfig
The number of configured replicas for this bucket.
numberOfReplicas
in interface CouchbaseBucketConfig
public boolean tainted()
BucketConfig
If a config is marked as tainted.
tainted
in interface BucketConfig
public boolean hasPrimaryPartitionsOnNode(InetAddress hostname)
CouchbaseBucketConfig
Checks if the given hostname has active primary partitions assigned to it.
hasPrimaryPartitionsOnNode
in interface CouchbaseBucketConfig
hostname
- the hostname of the node to check against.public short nodeIndexForMaster(int partition)
CouchbaseBucketConfig
Returns the node index for the given partition index and master.
nodeIndexForMaster
in interface CouchbaseBucketConfig
partition
- the index of the partition.public short nodeIndexForReplica(int partition, int replica)
CouchbaseBucketConfig
Returns the node index for the given partition index and the replica.
nodeIndexForReplica
in interface CouchbaseBucketConfig
partition
- the index of the partition.replica
- the replica number.public int numberOfPartitions()
CouchbaseBucketConfig
Returns the total number of partitions.
numberOfPartitions
in interface CouchbaseBucketConfig
public NodeInfo nodeAtIndex(int nodeIndex)
CouchbaseBucketConfig
Returns information for the node at the given index.
nodeAtIndex
in interface CouchbaseBucketConfig
nodeIndex
- the index of the node.public long rev()
BucketConfig
Revision number (optional) for that configuration.
rev
in interface BucketConfig
public BucketType type()
BucketConfig
The bucket type.
type
in interface BucketConfig
Copyright © 2014 Couchbase, Inc.