Class DefaultCouchbaseBucketConfig

java.lang.Object
com.couchbase.client.core.config.AbstractBucketConfig
com.couchbase.client.core.config.DefaultCouchbaseBucketConfig
All Implemented Interfaces:
BucketConfig, CouchbaseBucketConfig

public class DefaultCouchbaseBucketConfig
extends AbstractBucketConfig
implements CouchbaseBucketConfig
  • Field Details

    • PARTITION_NOT_EXISTENT

      public static final int PARTITION_NOT_EXISTENT
      See Also:
      Constant Field Values
  • Constructor Details

    • DefaultCouchbaseBucketConfig

      public DefaultCouchbaseBucketConfig​(long rev, String uuid, String name, String uri, String streamingUri, CouchbasePartitionInfo partitionInfo, List<NodeInfo> nodeInfos, List<PortInfo> portInfos, List<BucketCapabilities> bucketCapabilities, String origin)
      Creates a new CouchbaseBucketConfig.
      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: CouchbaseBucketConfig
      The number of configured replicas for this bucket.
      Specified by:
      numberOfReplicas in interface CouchbaseBucketConfig
      Returns:
      number of replicas.
    • tainted

      public boolean tainted()
      Description copied from interface: BucketConfig
      Returns true if the config indicates the cluster is undergoing a transition (such as a rebalance operation).
      Specified by:
      tainted in interface BucketConfig
      Returns:
      true if a transition is in progress.
    • hasPrimaryPartitionsOnNode

      public boolean hasPrimaryPartitionsOnNode​(String hostname)
      Description copied from interface: CouchbaseBucketConfig
      Checks if the given hostname has active primary partitions assigned to it.
      Specified by:
      hasPrimaryPartitionsOnNode in interface CouchbaseBucketConfig
      Parameters:
      hostname - the hostname of the node to check against.
      Returns:
      true if it has, false otherwise.
    • nodeIndexForMaster

      public short nodeIndexForMaster​(int partition, boolean useFastForward)
      Description copied from interface: CouchbaseBucketConfig
      Returns the node index for the given partition index and master.
      Specified by:
      nodeIndexForMaster in interface CouchbaseBucketConfig
      Parameters:
      partition - the index of the partition.
      useFastForward - if the fast forward config should be used.
      Returns:
      the index of the node.
    • nodeIndexForReplica

      public short nodeIndexForReplica​(int partition, int replica, boolean useFastForward)
      Description copied from interface: CouchbaseBucketConfig
      Returns the node index for the given partition index and the replica.
      Specified by:
      nodeIndexForReplica in interface CouchbaseBucketConfig
      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: CouchbaseBucketConfig
      Returns the total number of partitions.
      Specified by:
      numberOfPartitions in interface CouchbaseBucketConfig
      Returns:
      the number of partitions.
    • nodeAtIndex

      public NodeInfo nodeAtIndex​(int nodeIndex)
      Description copied from interface: CouchbaseBucketConfig
      Returns information for the node at the given index.
      Specified by:
      nodeAtIndex in interface CouchbaseBucketConfig
      Parameters:
      nodeIndex - the index of the node.
      Returns:
      the information of the node at this index.
    • rev

      public long rev()
      Description copied from interface: BucketConfig
      Revision number (optional) for that configuration.
      Specified by:
      rev in interface BucketConfig
      Returns:
      the rev number, might be 0.
    • type

      public BucketType type()
      Description copied from interface: BucketConfig
      The bucket type.
      Specified by:
      type in interface BucketConfig
      Returns:
      the bucket type.
    • hasFastForwardMap

      public boolean hasFastForwardMap()
      Description copied from interface: BucketConfig
      Returns 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:
      hasFastForwardMap in interface BucketConfig
      Returns:
      true if it does, false otherwise.
    • ephemeral

      public boolean ephemeral()
      Description copied from interface: CouchbaseBucketConfig
      If this couchbase bucket is ephemeral.
      Specified by:
      ephemeral in interface CouchbaseBucketConfig
      Returns:
      true if it is, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object