Class ClientCacheAffinityContext


  • public class ClientCacheAffinityContext
    extends Object
    Client cache partition awareness context.
    • Method Detail

      • updateLastTopologyVersion

        public boolean updateLastTopologyVersion​(AffinityTopologyVersion topVer,
                                                 UUID nodeId)
        Update topology version if it's greater than current version and store nodes for last topology.
        Parameters:
        topVer - Topology version.
        nodeId - Node id.
        Returns:
        True if last topology was updated to the new version.
      • affinityUpdateRequired

        public boolean affinityUpdateRequired​(int cacheId)
        Is affinity update required for given cache.
        Parameters:
        cacheId - Cache id.
      • writePartitionsUpdateRequest

        public void writePartitionsUpdateRequest​(org.apache.ignite.internal.client.thin.PayloadOutputChannel ch)
        Parameters:
        ch - Payload output channel.
      • readPartitionsUpdateResponse

        public boolean readPartitionsUpdateResponse​(org.apache.ignite.internal.client.thin.PayloadInputChannel ch)
        Parameters:
        ch - Payload input channel.
      • lastTopology

        public org.apache.ignite.internal.client.thin.ClientCacheAffinityContext.TopologyNodes lastTopology()
        Gets last topology information.
      • reset

        public void reset​(org.apache.ignite.internal.client.thin.ClientCacheAffinityContext.TopologyNodes top)
        Resets affinity context.
        Parameters:
        top - Topology which triggers reset.
      • affinityNode

        public UUID affinityNode​(int cacheId,
                                 Object key)
        Calculates affinity node for given cache and key.
        Parameters:
        cacheId - Cache ID.
        key - Key.
        Returns:
        Affinity node id or null if affinity node can't be determined for given cache and key.
      • affinityNode

        public UUID affinityNode​(int cacheId,
                                 int part)
        Calculates affinity node for given cache and partition.
        Parameters:
        cacheId - Cache ID.
        part - Partition.
        Returns:
        Affinity node id or null if affinity node can't be determined for given cache and partition.
      • registerCache

        public void registerCache​(String cacheName)
        Parameters:
        cacheName - Cache name.
      • unregisterCache

        public void unregisterCache​(String cacheName)
        Parameters:
        cacheName - Cache name.