Record Class ClusterStateTaskExecutor.LegacyClusterTaskResultActionListener

java.lang.Object
java.lang.Record
org.elasticsearch.cluster.ClusterStateTaskExecutor.LegacyClusterTaskResultActionListener
All Implemented Interfaces:
Consumer<ClusterState>
Enclosing interface:
ClusterStateTaskExecutor<T extends ClusterStateTaskListener>

@Deprecated public static record ClusterStateTaskExecutor.LegacyClusterTaskResultActionListener(ClusterStateTaskListener task, ClusterState originalState) extends Record implements Consumer<ClusterState>
Deprecated.
A Consumer for passing to ClusterStateTaskExecutor.TaskContext.success(java.lang.Runnable) which preserves the legacy behaviour of calling ClusterStateTaskListener.clusterStateProcessed(org.elasticsearch.cluster.ClusterState, org.elasticsearch.cluster.ClusterState) or ClusterStateTaskListener.onFailure(java.lang.Exception).

New implementations should use a dedicated listener rather than relying on this legacy behaviour.

  • Constructor Details

    • LegacyClusterTaskResultActionListener

      public LegacyClusterTaskResultActionListener(ClusterStateTaskListener task, ClusterState originalState)
      Deprecated.
      Creates an instance of a LegacyClusterTaskResultActionListener record class.
      Parameters:
      task - the value for the task record component
      originalState - the value for the originalState record component
  • Method Details

    • accept

      public void accept(ClusterState publishedState)
      Deprecated.
      Specified by:
      accept in interface Consumer<ClusterState>
    • toString

      public final String toString()
      Deprecated.
      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
    • hashCode

      public final int hashCode()
      Deprecated.
      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)
      Deprecated.
      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.
    • task

      public ClusterStateTaskListener task()
      Deprecated.
      Returns the value of the task record component.
      Returns:
      the value of the task record component
    • originalState

      public ClusterState originalState()
      Deprecated.
      Returns the value of the originalState record component.
      Returns:
      the value of the originalState record component