Interface IPartitionDistribution
Partition distribution provides table partition information. 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.
public interface IPartitionDistribution
Methods
GetPartitionAsync(IIgniteTuple)
Gets the partition for the specified table key.
ValueTask<IPartition> GetPartitionAsync(IIgniteTuple tuple)
Parameters
tupleIIgniteTupleTable key tuple.
Returns
- ValueTask<IPartition>
Partition that contains the specified key.
GetPartitionAsync<TK>(TK)
Gets the partition for the specified table key.
[RequiresUnreferencedCode("Object mapping uses runtime codegen and does not support AOT. Use overloads with IMapper<T> instead.")]
ValueTask<IPartition> GetPartitionAsync<TK>(TK key) where TK : notnull
Parameters
keyTKTable key.
Returns
- ValueTask<IPartition>
Partition that contains the specified key.
Type Parameters
TKKey type.
GetPartitionAsync<TK>(TK, IMapper<TK>)
Gets the partition for the specified table key.
ValueTask<IPartition> GetPartitionAsync<TK>(TK key, IMapper<TK> mapper) where TK : notnull
Parameters
keyTKTable key.
mapperIMapper<TK>Mapper for the key.
Returns
- ValueTask<IPartition>
Partition that contains the specified key.
Type Parameters
TKKey type.
GetPartitionsAsync()
Gets a list with all partitions.
ValueTask<IReadOnlyList<IPartition>> GetPartitionsAsync()
Returns
- ValueTask<IReadOnlyList<IPartition>>
A task representing the asynchronous operation with a list of all partitions.
GetPrimaryReplicaAsync(IPartition)
Gets the primary replica for the specified partition.
NOTE: Prefer this method over GetPrimaryReplicasAsync() for performance-critical code.ValueTask<IClusterNode> GetPrimaryReplicaAsync(IPartition partition)
Parameters
partitionIPartitionPartition.
Returns
- ValueTask<IClusterNode>
Primary replica.
GetPrimaryReplicasAsync()
Gets the primary replicas for all partitions.
NOTE: Prefer GetPrimaryReplicaAsync(IPartition) for performance-critical code.ValueTask<IReadOnlyDictionary<IPartition, IClusterNode>> GetPrimaryReplicasAsync()
Returns
- ValueTask<IReadOnlyDictionary<IPartition, IClusterNode>>
Map of partition to the primary replica node.
GetPrimaryReplicasAsync(IClusterNode)
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-assignment happens on the cluster.ValueTask<IReadOnlyList<IPartition>> GetPrimaryReplicasAsync(IClusterNode node)
Parameters
nodeIClusterNodeCluster node.
Returns
- ValueTask<IReadOnlyList<IPartition>>
A task representing the asynchronous operation with a list of all partitions hosted by the specified node as a primary replica.