Record Class JoinTaskExecutor.Task

java.lang.Object
java.lang.Record
org.elasticsearch.cluster.coordination.JoinTaskExecutor.Task
All Implemented Interfaces:
ClusterStateTaskListener
Enclosing class:
JoinTaskExecutor

public static record JoinTaskExecutor.Task(DiscoveryNode node, String reason, ActionListener<Void> listener) extends Record implements ClusterStateTaskListener
  • Constructor Details

    • Task

      public Task(DiscoveryNode node, String reason, ActionListener<Void> listener)
      Creates an instance of a Task record class.
      Parameters:
      node - the value for the node record component
      reason - the value for the reason record component
      listener - the value for the listener record component
  • Method Details

    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • isBecomeMasterTask

      public boolean isBecomeMasterTask()
    • isFinishElectionTask

      public boolean isFinishElectionTask()
    • onFailure

      public void onFailure(Exception e)
      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 at ERROR level and otherwise ignored, except in tests where it raises an AssertionError. 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 interface ClusterStateTaskListener
    • clusterStateProcessed

      public void clusterStateProcessed(ClusterState oldState, ClusterState newState)
      Description copied from interface: ClusterStateTaskListener
      Called when the result of the ClusterStateTaskExecutor.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 at ERROR level and otherwise ignored, except in tests where it raises an AssertionError. 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 interface ClusterStateTaskListener
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • node

      public DiscoveryNode node()
      Returns the value of the node record component.
      Returns:
      the value of the node record component
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • listener

      public ActionListener<Void> listener()
      Returns the value of the listener record component.
      Returns:
      the value of the listener record component