Affinity function for partitioned cache. This function supports the following configuration:
More...
Inherits GridGain::Client::IGridClientDataAffinity, and GridGain::Client::IGridClientTopologyListener.
List of all members.
Classes |
| class | NodeInfo |
| | Node info.
|
Public Member Functions |
| | GridClientPartitionAffinity () |
| | Empty constructor with all defaults.
|
| | GridClientPartitionAffinity (int parts, Predicate< Guid > backupsFilter) |
| | Initializes optional counts for replicas and backups. Note that excludeNeighbors parameter is ignored if backupFilter is set.
|
| TNode | Node< TNode > (Object key, ICollection< TNode > nodes) |
| void | OnNodeAdded (IGridClientNode node) |
| void | OnNodeRemoved (IGridClientNode node) |
Public Attributes |
| const int | DefaultPartitionsCount = 10000 |
| | Default number of partitions.
|
Properties |
| int | Partitions [get, set] |
| | Total number of key partitions. To ensure that all partitions are equally distributed across all nodes, please make sure that this number is significantly larger than a number of nodes. Also, partition size should be relatively small. Try to avoid having partitions with more than quarter million keys. Note that for fully replicated caches this method should always return 1.
|
| Predicate< Guid > | BackupsFilter [get, set] |
| | Optional backup filter. If not null, then primary nodes will be selected from all nodes outside of this filter, and backups will be selected from all nodes inside it. Note that excludeNeighbors parameter is ignored if backupFilter is set.
|
| Func< IGridClientNode, Object > | HashIdResolver [get, set] |
| | Gets hash ID resolver for nodes. This resolver is used to provide alternate hash ID, other than node ID. Node IDs constantly change when nodes get restarted, which causes them to be placed on different locations in the hash ring, and hence causing repartitioning. Providing an alternate hash ID, which survives node restarts, puts node on the same location on the hash ring, hence minimizing required repartitioning.
|
Detailed Description
-
backupFilter - Optional filter for back up nodes. If provided, then only nodes that pass this filter will be selected as backup nodes and only nodes that don't pass this filter will be selected as primary nodes. If not provided, then primary and backup nodes will be selected out of all nodes available for this cache.
NOTE: In situations where there are no primary nodes at all, i.e. no nodes for which backup filter returns false, first backup node for the key will be considered primary.
Constructor & Destructor Documentation
| GridGain.Client.GridClientPartitionAffinity.GridClientPartitionAffinity |
( |
|
) |
|
| GridGain.Client.GridClientPartitionAffinity.GridClientPartitionAffinity |
( |
int |
parts, |
|
|
Predicate< Guid > |
backupsFilter | |
|
) |
| | |
- Parameters:
-
| parts | Total number of partitions. |
| backupsFilter | Optional back up filter for nodes. If provided, then primary nodes |
will be selected from all nodes outside of this filter, and backups will be selected from all nodes inside it.
Member Function Documentation
| TNode GridGain.Client.GridClientPartitionAffinity.Node< TNode > |
( |
Object |
key, |
|
|
ICollection< TNode > |
nodes | |
|
) |
| | |
| void GridGain.Client.GridClientPartitionAffinity.OnNodeAdded |
( |
IGridClientNode |
node |
) |
|
| void GridGain.Client.GridClientPartitionAffinity.OnNodeRemoved |
( |
IGridClientNode |
node |
) |
|
Member Data Documentation
Property Documentation
Predicate<Guid> GridGain.Client.GridClientPartitionAffinity.BackupsFilter [get, set] |
Func<IGridClientNode, Object> GridGain.Client.GridClientPartitionAffinity.HashIdResolver [get, set] |
int GridGain.Client.GridClientPartitionAffinity.Partitions [get, set] |