Interface ClusterMapChangeListener


  • public interface ClusterMapChangeListener
    A ClusterMap listener that takes actions on local node when cluster map is changed.
    • Method Detail

      • onReplicaAddedOrRemoved

        void onReplicaAddedOrRemoved​(java.util.List<ReplicaId> addedReplicas,
                                     java.util.List<ReplicaId> removedReplicas)
        Take actions when replicas are added or removed on local node.
        Parameters:
        addedReplicas - ReplicaId(s) that have been added.
        removedReplicas - ReplicaId(s) that have been removed.
      • onRoutingTableChange

        default void onRoutingTableChange()
        Take actions when there is a routing table update. This is triggered whenever there is any change to state of a replicas in the cluster. On this trigger, we can look up the latest states of all the replicas from the routing table snapshot org.apache.helix.spectator.RoutingTableSnapshot with the help of various APIs provided in its class.