public class DatasetAffinityFunctionWrapper extends Object implements AffinityFunction
Constructor and Description |
---|
DatasetAffinityFunctionWrapper(AffinityFunction delegate)
Constructs a new instance of affinity function wrapper.
|
Modifier and Type | Method and Description |
---|---|
List<List<ClusterNode>> |
assignPartitions(AffinityFunctionContext affCtx)
Gets affinity nodes for a partition.
|
int |
partition(Object key)
Returns key as a partition index.
|
int |
partitions()
Gets total number of partitions available.
|
void |
removeNode(UUID nodeId)
Removes node from affinity.
|
void |
reset()
Resets cache affinity to its initial state.
|
public DatasetAffinityFunctionWrapper(AffinityFunction delegate)
delegate
- Affinity function which actually performs all methods except partition()
.public void reset()
reset
in interface AffinityFunction
public int partitions()
0
inclusively to
N
exclusively without any gaps.partitions
in interface AffinityFunction
public int partition(Object key)
partition
in interface AffinityFunction
key
- Partition index.public List<List<ClusterNode>> assignPartitions(AffinityFunctionContext affCtx)
Note that partitioned affinity must obey the following contract: given that node
N
is primary for some key K
, if any other node(s) leave
grid and no node joins grid, node N
will remain primary for key K
.
assignPartitions
in interface AffinityFunction
affCtx
- Affinity function context. Will provide all required information to calculate
new partition assignments.public void removeNode(UUID nodeId)
removeNode
in interface AffinityFunction
nodeId
- ID of node to remove.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019