Class ClusterChangedEvent


  • public class ClusterChangedEvent
    extends java.lang.Object
    An event received by the local node, signaling that the cluster state has changed.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean blocksChanged()
      Returns true iff the cluster level blocks have changed between cluster states.
      java.util.Set<java.lang.String> changedCustomMetaDataSet()
      Returns a set of custom meta data types when any custom metadata for the cluster has changed between the previous cluster state and the new cluster state.
      static boolean indexMetaDataChanged​(IndexMetaData metaData1, IndexMetaData metaData2)
      Returns true iff the IndexMetaData for a given index has changed between the previous cluster state and the new cluster state.
      boolean indexRoutingTableChanged​(java.lang.String index)
      Returns true iff the routing table has changed for the given index.
      java.util.List<java.lang.String> indicesCreated()
      Returns the indices created in this event
      java.util.List<Index> indicesDeleted()
      Returns the indices deleted in this event
      boolean isNewCluster()
      Determines whether or not the current cluster state represents an entirely new cluster, either when a node joins a cluster for the first time or when the node receives a cluster state update from a brand new cluster (different UUID from the previous cluster), which will happen when a master node is elected that has never been part of the cluster before.
      boolean localNodeMaster()
      Returns true iff the local node is the mater node of the cluster.
      boolean metaDataChanged()
      Returns true iff the metadata for the cluster has changed between the previous cluster state and the new cluster state.
      boolean nodesAdded()
      Returns true iff nodes have been added from the cluster since the last cluster state.
      boolean nodesChanged()
      Returns true iff nodes have been changed (added or removed) from the cluster since the last cluster state.
      DiscoveryNodes.Delta nodesDelta()
      Returns the DiscoveryNodes.Delta between the previous cluster state and the new cluster state.
      boolean nodesRemoved()
      Returns true iff nodes have been removed from the cluster since the last cluster state.
      ClusterState previousState()
      The previous cluster state for this change event.
      boolean routingTableChanged()
      Returns true iff the routing tables (for all indices) have changed between the previous cluster state and the current cluster state.
      java.lang.String source()
      The source that caused this cluster event to be raised.
      ClusterState state()
      The new cluster state that caused this change event.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClusterChangedEvent

        public ClusterChangedEvent​(java.lang.String source,
                                   ClusterState state,
                                   ClusterState previousState)
    • Method Detail

      • source

        public java.lang.String source()
        The source that caused this cluster event to be raised.
      • state

        public ClusterState state()
        The new cluster state that caused this change event.
      • previousState

        public ClusterState previousState()
        The previous cluster state for this change event.
      • routingTableChanged

        public boolean routingTableChanged()
        Returns true iff the routing tables (for all indices) have changed between the previous cluster state and the current cluster state. Note that this is an object reference equality test, not an equals test.
      • indexRoutingTableChanged

        public boolean indexRoutingTableChanged​(java.lang.String index)
        Returns true iff the routing table has changed for the given index. Note that this is an object reference equality test, not an equals test.
      • indicesCreated

        public java.util.List<java.lang.String> indicesCreated()
        Returns the indices created in this event
      • indicesDeleted

        public java.util.List<Index> indicesDeleted()
        Returns the indices deleted in this event
      • metaDataChanged

        public boolean metaDataChanged()
        Returns true iff the metadata for the cluster has changed between the previous cluster state and the new cluster state. Note that this is an object reference equality test, not an equals test.
      • changedCustomMetaDataSet

        public java.util.Set<java.lang.String> changedCustomMetaDataSet()
        Returns a set of custom meta data types when any custom metadata for the cluster has changed between the previous cluster state and the new cluster state. custom meta data types are returned iff they have been added, updated or removed between the previous and the current state
      • indexMetaDataChanged

        public static boolean indexMetaDataChanged​(IndexMetaData metaData1,
                                                   IndexMetaData metaData2)
        Returns true iff the IndexMetaData for a given index has changed between the previous cluster state and the new cluster state. Note that this is an object reference equality test, not an equals test.
      • blocksChanged

        public boolean blocksChanged()
        Returns true iff the cluster level blocks have changed between cluster states. Note that this is an object reference equality test, not an equals test.
      • localNodeMaster

        public boolean localNodeMaster()
        Returns true iff the local node is the mater node of the cluster.
      • nodesRemoved

        public boolean nodesRemoved()
        Returns true iff nodes have been removed from the cluster since the last cluster state.
      • nodesAdded

        public boolean nodesAdded()
        Returns true iff nodes have been added from the cluster since the last cluster state.
      • nodesChanged

        public boolean nodesChanged()
        Returns true iff nodes have been changed (added or removed) from the cluster since the last cluster state.
      • isNewCluster

        public boolean isNewCluster()
        Determines whether or not the current cluster state represents an entirely new cluster, either when a node joins a cluster for the first time or when the node receives a cluster state update from a brand new cluster (different UUID from the previous cluster), which will happen when a master node is elected that has never been part of the cluster before.