Record Class NodeRemovalClusterStateTaskExecutor.Task
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.coordination.NodeRemovalClusterStateTaskExecutor.Task
- All Implemented Interfaces:
ClusterStateTaskListener
- Enclosing class:
- NodeRemovalClusterStateTaskExecutor
public static record NodeRemovalClusterStateTaskExecutor.Task(DiscoveryNode node, String reason, Runnable onClusterStateProcessed)
extends Record
implements ClusterStateTaskListener
-
Constructor Summary
ConstructorDescriptionTask
(DiscoveryNode node, String reason, Runnable onClusterStateProcessed) Creates an instance of aTask
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clusterStateProcessed
(ClusterState oldState, ClusterState newState) Called when the result of theClusterStateTaskExecutor.execute(ClusterState, List)
have been processed properly by all listeners.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.node()
Returns the value of thenode
record component.Returns the value of theonClusterStateProcessed
record component.void
A callback for when task execution fails.void
A callback for when the task was rejected because the processing node is no longer the elected master.reason()
Returns the value of thereason
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
Task
Creates an instance of aTask
record class.- Parameters:
node
- the value for thenode
record componentreason
- the value for thereason
record componentonClusterStateProcessed
- the value for theonClusterStateProcessed
record component
-
-
Method Details
-
onFailure
Description copied from interface:ClusterStateTaskListener
A callback for when task execution fails. 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:
onFailure
in interfaceClusterStateTaskListener
-
onNoLongerMaster
public void onNoLongerMaster()Description copied from interface:ClusterStateTaskListener
A callback for when the task was rejected because the processing node is no longer the elected master. 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:
onNoLongerMaster
in interfaceClusterStateTaskListener
-
clusterStateProcessed
Description copied from interface:ClusterStateTaskListener
Called when the result of theClusterStateTaskExecutor.execute(ClusterState, List)
have been processed properly by all listeners. 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
-
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 thenode
record component.- Returns:
- the value of the
node
record component
-
reason
Returns the value of thereason
record component.- Returns:
- the value of the
reason
record component
-
onClusterStateProcessed
Returns the value of theonClusterStateProcessed
record component.- Returns:
- the value of the
onClusterStateProcessed
record component
-