Module org.elasticsearch.server
Record Class NodeLeftExecutor.Task
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.coordination.NodeLeftExecutor.Task
- All Implemented Interfaces:
ClusterStateTaskListener
- Enclosing class:
NodeLeftExecutor
public static record NodeLeftExecutor.Task(DiscoveryNode node, String reason, Runnable onClusterStateProcessed)
extends Record
implements ClusterStateTaskListener
-
Constructor Summary
ConstructorsConstructorDescriptionTask(DiscoveryNode node, String reason, Runnable onClusterStateProcessed) Creates an instance of aTaskrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.node()Returns the value of thenoderecord component.Returns the value of theonClusterStateProcessedrecord component.voidA callback for when task execution fails.reason()Returns the value of thereasonrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Task
Creates an instance of aTaskrecord class.- Parameters:
node- the value for thenoderecord componentreason- the value for thereasonrecord componentonClusterStateProcessed- the value for theonClusterStateProcessedrecord component
-
-
Method Details
-
onFailure
Description copied from interface:ClusterStateTaskListenerA callback for when task execution fails. May receive aNotMasterExceptionif this node stopped being the master before this task was executed or aProcessClusterEventTimeoutExceptionif the task timed out before it was executed. If the task fails during execution then this method receives the corresponding exception. If the task executes successfully but the resulting cluster state publication fails then this method receives aFailedToCommitClusterStateException. If publication fails then a new master is elected and the update might or might not take effect, depending on whether or not the newly-elected master accepted the published state that failed to be committed.Use
MasterService.isPublishFailureException(java.lang.Exception)to detect the "expected" master failure cases if needed.Implementations of this callback must not throw exceptions: an exception thrown here is logged by the master service at
ERRORlevel 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:
onFailurein interfaceClusterStateTaskListener
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
node
Returns the value of thenoderecord component.- Returns:
- the value of the
noderecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
onClusterStateProcessed
Returns the value of theonClusterStateProcessedrecord component.- Returns:
- the value of the
onClusterStateProcessedrecord component
-