Classes | Public Member Functions | Public Attributes | Properties

GridGain.Client.GridClientPartitionAffinity Class Reference

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


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 
)

<inheritdoc>

Type Constraints
TNode :IGridClientNode 
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]