Apache Ignite.NET
Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase Class Reference

Base class for predefined affinity functions. More...

Inheritance diagram for Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase:
Apache.Ignite.Core.Cache.Affinity.IAffinityFunction Apache.Ignite.Core.Cache.Affinity.Rendezvous.RendezvousAffinityFunction

Public Member Functions

virtual 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...
 
virtual void RemoveNode (Guid nodeId)
 Removes node from affinity. This method is called when it is safe to remove disconnected node from affinity mapping. More...
 
virtual 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...
 

Public Attributes

const int DefaultPartitions = 1024
 The default value for Partitions property. More...
 

Properties

virtual int Partitions [get, set]
 Gets or sets the total number of partitions. More...
 
virtual bool ExcludeNeighbors [get, set]
 Gets or sets a value indicating whether to exclude same-host-neighbors from being backups of each other. More...
 
- Properties inherited from Apache.Ignite.Core.Cache.Affinity.IAffinityFunction
int Partitions [get]
 Gets the total number of partitions. More...
 

Detailed Description

Member Function Documentation

virtual IEnumerable<IEnumerable<IClusterNode> > Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.AssignPartitions ( AffinityFunctionContext  context)
virtual

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.

Parameters
contextThe affinity function context.
Returns
A collection of partitions, where each partition is a collection of nodes, where first node is a primary node, and other nodes are backup nodes.

Implements Apache.Ignite.Core.Cache.Affinity.IAffinityFunction.

virtual int Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.GetPartition ( object  key)
virtual

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.

Parameters
keyKey to get partition for.
Returns
Partition number for a given key.

Implements Apache.Ignite.Core.Cache.Affinity.IAffinityFunction.

virtual void Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.RemoveNode ( Guid  nodeId)
virtual
Parameters
nodeIdThe node identifier.

Implements Apache.Ignite.Core.Cache.Affinity.IAffinityFunction.

Member Data Documentation

const int Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.DefaultPartitions = 1024

Property Documentation

virtual bool Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.ExcludeNeighbors
getset
virtual int Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.Partitions
getset