java.lang.Object
org.elasticsearch.cluster.LocalMasterServiceTask
- All Implemented Interfaces:
ClusterStateTaskListener
Used to execute things on the master service thread on nodes that are not necessarily master
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
clusterStateProcessed
(ClusterState oldState, ClusterState newState) Called when the result of theClusterStateTaskExecutor.execute(ClusterState, List)
method have been processed properly by all listeners.protected void
execute
(ClusterState currentState) protected void
void
submit
(MasterService masterService, String source) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.ClusterStateTaskListener
onFailure
-
Constructor Details
-
LocalMasterServiceTask
-
-
Method Details
-
execute
- Throws:
Exception
-
clusterStateProcessed
Description copied from interface:ClusterStateTaskListener
Called when the result of theClusterStateTaskExecutor.execute(ClusterState, List)
method have been processed properly by all listeners. The parameter is the state that was ultimately published. This can lead to surprising behaviour if tasks are batched together: a later task in the batch may undo or overwrite the changes made by an earlier task. In general you should prefer to ignore the published state and instead handle the success of a publication via the listener that the executor passes toClusterStateTaskExecutor.TaskContext.success(org.elasticsearch.action.ActionListener<org.elasticsearch.cluster.ClusterState>)
. Implementations of this callback must not throw exceptions: an exception thrown here is logged by the master service atERROR
level and otherwise ignored, except in tests where it raises anAssertionError
. If log-and-ignore is the right behaviour then implementations must do so themselves, typically using a more specific logger and at a less dramatic log level.- Specified by:
clusterStateProcessed
in interfaceClusterStateTaskListener
-
onPublicationComplete
protected void onPublicationComplete() -
submit
-