Package org.elasticsearch.cluster
Class ClusterChangedEvent
java.lang.Object
org.elasticsearch.cluster.ClusterChangedEvent
public class ClusterChangedEvent
extends java.lang.Object
An event received by the local node, signaling that the cluster state has changed.
-
Constructor Summary
Constructors Constructor Description ClusterChangedEvent(java.lang.String source, ClusterState state, ClusterState previousState) -
Method Summary
Modifier and Type Method Description booleanblocksChanged()Returnstrueiff 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 booleanindexMetadataChanged(IndexMetadata metadata1, IndexMetadata metadata2)Returnstrueiff theIndexMetadatafor a given index has changed between the previous cluster state and the new cluster state.booleanindexRoutingTableChanged(java.lang.String index)Returnstrueiff the routing table has changed for the given index.java.util.List<java.lang.String>indicesCreated()Returns the indices created in this eventjava.util.List<Index>indicesDeleted()Returns the indices deleted in this eventbooleanisNewCluster()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.booleanlocalNodeMaster()Returnstrueiff the local node is the mater node of the cluster.booleanmetadataChanged()Returnstrueiff the metadata for the cluster has changed between the previous cluster state and the new cluster state.booleannodesAdded()Returnstrueiff nodes have been added from the cluster since the last cluster state.booleannodesChanged()Returnstrueiff nodes have been changed (added or removed) from the cluster since the last cluster state.DiscoveryNodes.DeltanodesDelta()Returns theDiscoveryNodes.Deltabetween the previous cluster state and the new cluster state.booleannodesRemoved()Returnstrueiff nodes have been removed from the cluster since the last cluster state.ClusterStatepreviousState()The previous cluster state for this change event.booleanroutingTableChanged()Returnstrueif the routing tables (for all indices) have changed between the previous cluster state and the current cluster state.java.lang.Stringsource()The source that caused this cluster event to be raised.ClusterStatestate()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
-
ClusterChangedEvent
public ClusterChangedEvent(java.lang.String source, ClusterState state, ClusterState previousState)
-
-
Method Details
-
source
public java.lang.String source()The source that caused this cluster event to be raised. -
state
The new cluster state that caused this change event. -
previousState
The previous cluster state for this change event. -
routingTableChanged
public boolean routingTableChanged()Returnstrueif 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)Returnstrueiff 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
Returns the indices deleted in this event -
metadataChanged
public boolean metadataChanged()Returnstrueiff 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
Returnstrueiff theIndexMetadatafor 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()Returnstrueiff 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()Returnstrueiff the local node is the mater node of the cluster. -
nodesDelta
Returns theDiscoveryNodes.Deltabetween the previous cluster state and the new cluster state. -
nodesRemoved
public boolean nodesRemoved()Returnstrueiff nodes have been removed from the cluster since the last cluster state. -
nodesAdded
public boolean nodesAdded()Returnstrueiff nodes have been added from the cluster since the last cluster state. -
nodesChanged
public boolean nodesChanged()Returnstrueiff 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.
-