Class GridAffinityFunctionContextImpl

    • Method Detail

      • previousAssignment

        @Nullable
        public @Nullable List<ClusterNode> previousAssignment​(int part)
        Gets affinity assignment for given partition on previous topology version. First node in returned list is a primary node, other nodes are backups.
        Specified by:
        previousAssignment in interface AffinityFunctionContext
        Parameters:
        part - Partition to get previous assignment for.
        Returns:
        List of nodes assigned to given partition on previous topology version or null if this information is not available.
      • currentTopologySnapshot

        public List<ClusterNode> currentTopologySnapshot()
        Gets current topology snapshot. Snapshot will contain only nodes on which particular cache is configured. List of passed nodes is guaranteed to be sorted in a same order on all nodes on which partition assignment is performed.
        Specified by:
        currentTopologySnapshot in interface AffinityFunctionContext
        Returns:
        Cache topology snapshot.
      • discoveryEvent

        @Nullable
        public @Nullable DiscoveryEvent discoveryEvent()
        Gets discovery event caused topology change.
        Specified by:
        discoveryEvent in interface AffinityFunctionContext
        Returns:
        Discovery event caused latest topology change or null if this information is not available.
      • backups

        public int backups()
        Gets number of backups for new assignment.
        Specified by:
        backups in interface AffinityFunctionContext
        Returns:
        Number of backups for new assignment.
      • prevAssignment

        public List<List<ClusterNode>> prevAssignment()
        Gets the previous assignment.
        Returns:
        Previous assignment