Apache Ignite.NET
|
Represents a function that maps cache keys to cluster nodes. More...
Public Member Functions | |
int | GetPartition (object key) |
Gets partition number for a given key starting from 0. Partitioned caches should make sure that keys are about evenly distributed across all partitions from 0 to Partitions for best performance. More... | |
void | RemoveNode (Guid nodeId) |
Removes node from affinity. This method is called when it is safe to remove disconnected node from affinity mapping. More... | |
IEnumerable< IEnumerable< IClusterNode > > | AssignPartitions (AffinityFunctionContext context) |
Gets affinity nodes for a partition. In case of replicated cache, all returned nodes are updated in the same manner. In case of partitioned cache, the returned list should contain only the primary and back up nodes with primary node being always first. <pare> Note that partitioned affinity must obey the following contract: given that node More... | |
Properties | |
int | Partitions [get] |
Gets the total number of partitions. More... | |
Predefined implementations: RendezvousAffinityFunction, FairAffinityFunction.
IEnumerable<IEnumerable<IClusterNode> > Apache.Ignite.Core.Cache.Affinity.IAffinityFunction.AssignPartitions | ( | AffinityFunctionContext | context | ) |
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
.
context | The affinity function context. |
int Apache.Ignite.Core.Cache.Affinity.IAffinityFunction.GetPartition | ( | object | key | ) |
Note that for fully replicated caches it is possible to segment key sets among different grid node groups. In that case each node group should return a unique partition number. However, unlike partitioned cache, mappings of keys to nodes in replicated caches are constant and a node cannot migrate from one partition to another.
key | Key to get partition for. |
void Apache.Ignite.Core.Cache.Affinity.IAffinityFunction.RemoveNode | ( | Guid | nodeId | ) |
nodeId | The node identifier. |
|
get |
All caches should always provide correct partition count which should be the same on all participating nodes. Note that partitions should always be numbered from 0 inclusively to N exclusively without any gaps.