Interface PartitionDistribution

All Known Subinterfaces:
PartitionManager

public interface PartitionDistribution
The partition distribution provides the ability to obtain information about table partitions. This interface can be used to get all partitions of a table, the location of the primary replica of a partition, the partition for a specific table key.
  • Method Details

    • partitionsAsync

      CompletableFuture<List<Partition>> partitionsAsync()
      Asynchronously gets a list with all partitions.
      Returns:
      Future with list with all partitions.
    • partitions

      List<Partition> partitions()
      Gets a list with all partitions.
      Returns:
      List with all partitions.
    • primaryReplicasAsync

      CompletableFuture<Map<Partition,ClusterNode>> primaryReplicasAsync()
      Asynchronously gets map with all partitions and their locations as of the time of the call.

      Note: This assignment may become outdated if a re-assigment happens on the cluster.

      Returns:
      Future with map from partition to cluster node where primary replica of the partition is located as of the time of the call.
    • primaryReplicasAsync

      CompletableFuture<List<Partition>> primaryReplicasAsync(ClusterNode node)
      Asynchronously gets all partitions hosted by the specified node as a primary replica.
      Returns:
      Future with list with all partitions hosted by the specified node as a primary replica.
    • primaryReplicas

      Map<Partition,ClusterNode> primaryReplicas()
      Gets map with all partitions and their locations as of the time of the call.

      Note: This assignment may become outdated if a re-assigment happens on the cluster.

      Returns:
      Map from partition to cluster node where primary replica of the partition is located as of the time of the call.
    • primaryReplicas

      List<Partition> primaryReplicas(ClusterNode node)
      Gets all partitions hosted by the specified node as a primary replica as of the time of the call.

      Note: This assignment may become outdated if a re-assigment happens on the cluster.

      Returns:
      List with all partitions hosted by the specified node as a primary replica as of the time of the call.
    • primaryReplicaAsync

      CompletableFuture<ClusterNode> primaryReplicaAsync(Partition partition)
      Asynchronously gets the current location of the primary replica for the provided partition.

      Note: This assignment may become outdated if a re-assigment happens on the cluster.

      Parameters:
      partition - Partition instance.
      Returns:
      Future that represents the pending completion of the operation.
      See Also:
    • primaryReplica

      ClusterNode primaryReplica(Partition partition)
      Gets the current location of the primary replica for the provided partition.

      Note: This assignment may become outdated if a re-assigment happens on the cluster.

      Parameters:
      partition - Partition instance.
      Returns:
      Cluster node where primary replica of provided partition is located as of the time of the call.
    • partitionAsync

      <K> CompletableFuture<Partition> partitionAsync(K key, Mapper<K> mapper)
      Asynchronously gets partition instance for provided table key.
      Type Parameters:
      K - Key type.
      Parameters:
      key - Table key.
      mapper - Table key mapper.
      Returns:
      Future with partition instance which contains provided key.
    • partitionAsync

      CompletableFuture<Partition> partitionAsync(Tuple key)
      Asynchronously gets partition instance for provided table key.
      Parameters:
      key - Table key tuple.
      Returns:
      Future with partition instance which contains provided key.
    • partition

      <K> Partition partition(K key, Mapper<K> mapper)
      Gets partition instance for provided table key.
      Type Parameters:
      K - Key type.
      Parameters:
      key - Table key.
      mapper - Table key mapper.
      Returns:
      Partition instance which contains provided key.
    • partition

      Partition partition(Tuple key)
      Gets partition instance for provided table key.
      Parameters:
      key - Table key tuple.
      Returns:
      Partition instance which contains provided key.