Package org.elasticsearch.cluster
Class ClusterChangedEvent
java.lang.Object
org.elasticsearch.cluster.ClusterChangedEvent
An event received by the local node, signaling that the cluster state has changed.
-
Constructor Summary
ConstructorDescriptionClusterChangedEvent(String source, ClusterState state, ClusterState previousState)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
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
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(String index)
Returnstrue
iff the routing table has changed for the given index.Returns the indices created in this eventReturns the indices deleted in this eventboolean
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
Returnstrue
iff the local node is the mater node of the cluster.boolean
Returnstrue
iff the metadata for the cluster has changed between the previous cluster state and the new cluster state.boolean
Returnstrue
iff nodes have been added from the cluster since the last cluster state.boolean
Returnstrue
iff nodes have been changed (added or removed) from the cluster since the last cluster state.Returns theDiscoveryNodes.Delta
between the previous cluster state and the new cluster state.boolean
Returnstrue
iff nodes have been removed from the cluster since the last cluster state.The previous cluster state for this change event.boolean
Returnstrue
if the routing tables (for all indices) have changed between the previous cluster state and the current cluster state.source()
The source that caused this cluster event to be raised.state()
The new cluster state that caused this change event.
-
Constructor Details
-
ClusterChangedEvent
-
-
Method Details
-
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
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
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
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
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.
-