Class PartitionMap

java.lang.Object
com.couchbase.client.core.topology.PartitionMap

@Internal public class PartitionMap extends Object
A map from partition index to info about the partition.
  • Constructor Details

  • Method Details

    • get

      public PartitionTopology get(int partition)
    • values

      public List<PartitionTopology> values()
    • size

      public int size()
      Returns the number of partitions.
    • forEach

      public void forEach(BiConsumer<Integer,PartitionTopology> action)
      Passes each map entry to the given consumer.
      Parameters:
      action - First argument is partition index, second argument is info about the associated partition.
    • active

      public Optional<HostAndServicePorts> active(int partition)
      Returns info about the node hosting the active instance of the given partition (vBucket), or empty if the active is not currently available or there is no such partition.
    • availableReplicas

      public List<HostAndServicePorts> availableReplicas(int partition)
      Returns info about the nodes hosting replica instances of the given partition (vBucket), or empty if no replicas are currently available or there is no such partition.
    • toString

      public String toString()
      Overrides:
      toString in class Object