Class DefaultPartition

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

public class DefaultPartition
extends Object
implements Partition
  • Constructor Details

    • DefaultPartition

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

    • master

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

      public short 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