org.apache.ignite.internal.client

## Interface GridClientDataAffinity

All Known Implementing Classes:
  GridClientPartitionAffinity

    public interface GridClientDataAffinity

Determines which node should be connected when operation on a key is requested.

If implementation of data affinity implements `GridClientTopologyListener` interface 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

Methods
`GridClientNode` `node(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.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0-b1
Release Date | : December 1 2015