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 boolean
blocksChanged()
Returnstrue
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)
Returnstrue
iff theIndexMetaData
for a given index has changed between the previous cluster state and the new cluster state.boolean
indexRoutingTableChanged(java.lang.String index)
Returnstrue
iff 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 eventboolean
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()
Returnstrue
iff the local node is the mater node of the cluster.boolean
metaDataChanged()
Returnstrue
iff the metadata for the cluster has changed between the previous cluster state and the new cluster state.boolean
nodesAdded()
Returnstrue
iff nodes have been added from the cluster since the last cluster state.boolean
nodesChanged()
Returnstrue
iff nodes have been changed (added or removed) from the cluster since the last cluster state.DiscoveryNodes.Delta
nodesDelta()
Returns theDiscoveryNodes.Delta
between the previous cluster state and the new cluster state.boolean
nodesRemoved()
Returnstrue
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()
Returnstrue
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.
-
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()Returnstrue
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)Returnstrue
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
Returns the indices deleted in this event -
metaDataChanged
public boolean metaDataChanged()Returnstrue
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
Returnstrue
iff theIndexMetaData
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()Returnstrue
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()Returnstrue
iff the local node is the mater node of the cluster. -
nodesDelta
Returns theDiscoveryNodes.Delta
between the previous cluster state and the new cluster state. -
nodesRemoved
public boolean nodesRemoved()Returnstrue
iff nodes have been removed from the cluster since the last cluster state. -
nodesAdded
public boolean nodesAdded()Returnstrue
iff nodes have been added from the cluster since the last cluster state. -
nodesChanged
public boolean nodesChanged()Returnstrue
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.
-