Class ClusterChangedEvent

java.lang.Object
org.elasticsearch.cluster.ClusterChangedEvent

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

    Constructors
    Constructor
    Description
    ClusterChangedEvent(String source, ClusterState state, ClusterState previousState)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true iff the cluster level blocks have changed between cluster states.
    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
    Returns true iff the IndexMetadata for a given index has changed between the previous cluster state and the new cluster state.
    boolean
    Returns true iff the routing table has changed for the given index.
    Returns the indices created in this event
    Returns the indices deleted in this event
    boolean
    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
    Returns true iff the local node is the mater node of the cluster.
    boolean
    Returns true iff the metadata for the cluster has changed between the previous cluster state and the new cluster state.
    boolean
    Returns true iff nodes have been added from the cluster since the last cluster state.
    boolean
    Returns true iff nodes have been changed (added or removed) from the cluster since the last cluster state.
    Returns the DiscoveryNodes.Delta between the previous cluster state and the new cluster state.
    boolean
    Returns true iff nodes have been removed from the cluster since the last cluster state.
    The previous cluster state for this change event.
    boolean
    Returns true if the routing tables (for all indices) have changed between the previous cluster state and the current cluster state.
    The source that caused this cluster event to be raised.
    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 Details

  • Method Details

    • source

      public 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 if 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(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 List<String> indicesCreated()
      Returns the indices created in this event
    • indicesDeleted

      public 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 Set<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.
    • nodesDelta

      public DiscoveryNodes.Delta nodesDelta()
      Returns the DiscoveryNodes.Delta between the previous cluster state and the new cluster state.
    • 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.