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 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.