Class DefaultCouchbaseBucketConfig
java.lang.Object
com.couchbase.client.dcp.core.config.AbstractBucketConfig
com.couchbase.client.dcp.core.config.DefaultCouchbaseBucketConfig
- All Implemented Interfaces:
BucketConfig,CouchbaseBucketConfig
public class DefaultCouchbaseBucketConfig
extends AbstractBucketConfig
implements CouchbaseBucketConfig
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCouchbaseBucketConfig(long rev, long revEpoch, String uuid, String name, String uri, String streamingUri, CouchbasePartitionInfo partitionInfo, List<NodeInfo> nodeInfos, List<PortInfo> portInfos, List<BucketCapabilities> bucketCapabilities, String origin) Creates a newCouchbaseBucketConfig. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIf this couchbase bucket is ephemeral.booleanReturns true if the config has a fast forward map that describes what the topology of the cluster will be after the current rebalance operation completes.booleanhasPrimaryPartitionsOnNode(String hostname) Checks if the given hostname has active primary partitions assigned to it.nodeAtIndex(int nodeIndex) Returns information for the node at the given index.intnodeIndexForMaster(int partition, boolean useFastForward) Returns the node index for the given partition index and master.intnodeIndexForReplica(int partition, int replica, boolean useFastForward) Returns the node index for the given partition index and the replica.intReturns the total number of partitions.intThe number of configured replicas for this bucket.rev()Revision number (optional) for that configuration.booleantainted()Returns true if the config indicates the cluster is undergoing a transition (such as a rebalance operation).toString()type()The bucket type.Methods inherited from class com.couchbase.client.dcp.core.config.AbstractBucketConfig
capabilities, locator, name, nodes, password, password, serviceEnabled, streamingUri, uri, useAlternateNetwork, useAlternateNetwork, username, username, uuidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.couchbase.client.dcp.core.config.BucketConfig
capabilities, locator, name, nodes, password, password, serviceEnabled, streamingUri, uri, useAlternateNetwork, useAlternateNetwork, username, username, uuid
-
Field Details
-
PARTITION_NOT_EXISTENT
public static final int PARTITION_NOT_EXISTENT- See Also:
-
-
Constructor Details
-
DefaultCouchbaseBucketConfig
public DefaultCouchbaseBucketConfig(long rev, long revEpoch, String uuid, String name, String uri, String streamingUri, CouchbasePartitionInfo partitionInfo, List<NodeInfo> nodeInfos, List<PortInfo> portInfos, List<BucketCapabilities> bucketCapabilities, String origin) Creates a newCouchbaseBucketConfig.- Parameters:
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.
-
-
Method Details
-
numberOfReplicas
public int numberOfReplicas()Description copied from interface:CouchbaseBucketConfigThe number of configured replicas for this bucket.- Specified by:
numberOfReplicasin interfaceCouchbaseBucketConfig- Returns:
- number of replicas.
-
tainted
public boolean tainted()Description copied from interface:BucketConfigReturns true if the config indicates the cluster is undergoing a transition (such as a rebalance operation).- Specified by:
taintedin interfaceBucketConfig- Returns:
- true if a transition is in progress.
-
hasPrimaryPartitionsOnNode
Description copied from interface:CouchbaseBucketConfigChecks if the given hostname has active primary partitions assigned to it.- Specified by:
hasPrimaryPartitionsOnNodein interfaceCouchbaseBucketConfig- Parameters:
hostname- the hostname of the node to check against.- Returns:
- true if it has, false otherwise.
-
nodeIndexForMaster
public int nodeIndexForMaster(int partition, boolean useFastForward) Description copied from interface:CouchbaseBucketConfigReturns the node index for the given partition index and master.- Specified by:
nodeIndexForMasterin interfaceCouchbaseBucketConfig- Parameters:
partition- the index of the partition.useFastForward- if the fast forward config should be used.- Returns:
- the index of the node.
-
nodeIndexForReplica
public int nodeIndexForReplica(int partition, int replica, boolean useFastForward) Description copied from interface:CouchbaseBucketConfigReturns the node index for the given partition index and the replica.- Specified by:
nodeIndexForReplicain interfaceCouchbaseBucketConfig- Parameters:
partition- the index of the partition.replica- the replica number.useFastForward- if the fast forward config should be used.- Returns:
- the index of the node.
-
numberOfPartitions
public int numberOfPartitions()Description copied from interface:CouchbaseBucketConfigReturns the total number of partitions.- Specified by:
numberOfPartitionsin interfaceCouchbaseBucketConfig- Returns:
- the number of partitions.
-
nodeAtIndex
Description copied from interface:CouchbaseBucketConfigReturns information for the node at the given index.- Specified by:
nodeAtIndexin interfaceCouchbaseBucketConfig- Parameters:
nodeIndex- the index of the node.- Returns:
- the information of the node at this index.
-
rev
Description copied from interface:BucketConfigRevision number (optional) for that configuration.- Specified by:
revin interfaceBucketConfig- Returns:
- the rev number, might be 0.
-
type
Description copied from interface:BucketConfigThe bucket type.- Specified by:
typein interfaceBucketConfig- Returns:
- the bucket type.
-
hasFastForwardMap
public boolean hasFastForwardMap()Description copied from interface:BucketConfigReturns true if the config has a fast forward map that describes what the topology of the cluster will be after the current rebalance operation completes.- Specified by:
hasFastForwardMapin interfaceBucketConfig- Returns:
- true if it does, false otherwise.
-
ephemeral
public boolean ephemeral()Description copied from interface:CouchbaseBucketConfigIf this couchbase bucket is ephemeral.- Specified by:
ephemeralin interfaceCouchbaseBucketConfig- Returns:
- true if it is, false otherwise.
-
toString
-