org.apache.hadoop.mapreduce.jobhistory

## Class TaskAttemptFinishedEvent

- java.lang.Object
- - org.apache.hadoop.mapreduce.jobhistory.TaskAttemptFinishedEvent

- All Implemented Interfaces:
    HistoryEvent

      @InterfaceAudience.Private
       @InterfaceStability.Unstable
      public class TaskAttemptFinishedEvent
      extends Object
      implements HistoryEvent

  Event to record successful task completion

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskAttemptFinishedEvent(TaskAttemptID id, TaskType taskType, String taskStatus, long finishTime, String rackName, String hostname, String state, Counters counters)`
    `TaskAttemptFinishedEvent(TaskAttemptID id, TaskType taskType, String taskStatus, long finishTime, String rackName, String hostname, String state, Counters counters, long startTs)` Create an event to record successful finishes for setup and cleanup attempts.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TaskAttemptID` | `getAttemptId()` Gets the task attempt id.
    `Object` | `getDatum()` Return the Avro datum wrapped by this.
    `EventType` | `getEventType()` Gets the event type.
    `long` | `getFinishTime()` Gets the attempt finish time.
    `String` | `getHostname()` Gets the host where the attempt executed.
    `String` | `getRackName()` Gets the rackname where the attempt executed.
    `long` | `getStartTime()` Gets the task attempt start time to be used while publishing to ATSv2.
    `String` | `getState()` Gets the state string.
    `TaskID` | `getTaskId()` Gets the task ID.
    `String` | `getTaskStatus()` Gets the task status.
    `TaskType` | `getTaskType()` Gets the task type.
    `Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric>` | `getTimelineMetrics()` Counters or Metrics if any else return null.
    `void` | `setDatum(Object oDatum)` Set the Avro datum wrapped by this.
    `org.apache.hadoop.yarn.api.records.timelineservice.TimelineEvent` | `toTimelineEvent()` Map HistoryEvent to TimelineEvent.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TaskAttemptFinishedEvent

          public TaskAttemptFinishedEvent(TaskAttemptID id,
                                          TaskType taskType,
                                          String taskStatus,
                                          long finishTime,
                                          String rackName,
                                          String hostname,
                                          String state,
                                          Counters counters,
                                          long startTs)

      Create an event to record successful finishes for setup and cleanup attempts.
      Parameters:
        `id` - Attempt ID
        `taskType` - Type of task
        `taskStatus` - Status of task
        `finishTime` - Finish time of attempt
        `hostname` - Host where the attempt executed
        `state` - State string
        `counters` - Counters for the attempt
        `startTs` - Task start time to be used for writing entity to ATSv2.

    - #### TaskAttemptFinishedEvent

          public TaskAttemptFinishedEvent(TaskAttemptID id,
                                          TaskType taskType,
                                          String taskStatus,
                                          long finishTime,
                                          String rackName,
                                          String hostname,
                                          String state,
                                          Counters counters)

  - ### Method Detail

    - #### getDatum

          public Object getDatum()

      Description copied from interface: `HistoryEvent`
      Return the Avro datum wrapped by this.
      Specified by:
        `getDatum` in interface `HistoryEvent`

    - #### setDatum

          public void setDatum(Object oDatum)

      Description copied from interface: `HistoryEvent`
      Set the Avro datum wrapped by this.
      Specified by:
        `setDatum` in interface `HistoryEvent`

    - #### getTaskId

          public TaskID getTaskId()

      Gets the task ID.

    - #### getAttemptId

          public TaskAttemptID getAttemptId()

      Gets the task attempt id.

    - #### getTaskType

          public TaskType getTaskType()

      Gets the task type.

    - #### getTaskStatus

          public String getTaskStatus()

      Gets the task status.

    - #### getFinishTime

          public long getFinishTime()

      Gets the attempt finish time.

    - #### getStartTime

          public long getStartTime()

      Gets the task attempt start time to be used while publishing to ATSv2.
      Returns:
        task attempt start time.

    - #### getHostname

          public String getHostname()

      Gets the host where the attempt executed.

    - #### getRackName

          public String getRackName()

      Gets the rackname where the attempt executed.

    - #### getState

          public String getState()

      Gets the state string.
      Returns:
        task attempt state.

    - #### getEventType

          public EventType getEventType()

      Gets the event type.
      Specified by:
        `getEventType` in interface `HistoryEvent`

    - #### toTimelineEvent

          public org.apache.hadoop.yarn.api.records.timelineservice.TimelineEvent toTimelineEvent()

      Description copied from interface: `HistoryEvent`
      Map HistoryEvent to TimelineEvent.
      Specified by:
        `toTimelineEvent` in interface `HistoryEvent`
      Returns:
        the timeline event

    - #### getTimelineMetrics

          public Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric> getTimelineMetrics()

      Description copied from interface: `HistoryEvent`
      Counters or Metrics if any else return null.
      Specified by:
        `getTimelineMetrics` in interface `HistoryEvent`
      Returns:
        the set of timeline metrics

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.