Interface GridClientDataAffinity
-
- All Known Implementing Classes:
GridClientPartitionAffinity
public interface GridClientDataAffinityDetermines which node should be connected when operation on a key is requested.If implementation of data affinity implements
GridClientTopologyListenerinterface as well, then affinity will be added to topology listeners on client start before first connection is established and will be removed after last connection is closed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GridClientNodenode(Object key, Collection<? extends GridClientNode> nodes)Gets primary affinity node for a key.
-
-
-
Method Detail
-
node
GridClientNode node(Object key, Collection<? extends GridClientNode> nodes)
Gets primary affinity node for a key. In case of replicated cache all nodes are equal and can be considered primary, so it may return any node. In case of partitioned cache primary node is returned.- Parameters:
key- Key to get affinity for.nodes- Nodes to choose from.- Returns:
- Affinity nodes for the given partition.
-
-