Class DefaultPartition

java.lang.Object
com.couchbase.client.dcp.core.config.DefaultPartition
All Implemented Interfaces:
Partition

public class DefaultPartition extends Object implements Partition
  • Constructor Details

    • DefaultPartition

      public DefaultPartition(int primary, int[] replicas)
      Creates a new DefaultPartition.
      Parameters:
      primary - the array index of the master
      replicas - the array indexes of the replicas.
  • Method Details

    • primary

      public int primary()
      Description copied from interface: Partition
      Returns the master node index for this partition.
      Specified by:
      primary in interface Partition
      Returns:
      the master node index.
    • replica

      public int replica(int num)
      Description copied from interface: Partition
      Returns the replica index for this partition.
      Specified by:
      replica in interface Partition
      Parameters:
      num - number of replica.
      Returns:
      the replica node index, -1 if not set.
    • toString

      public String toString()
      Overrides:
      toString in class Object