org.apache.hadoop.mapred

## Class TaskCompletionEvent

- java.lang.Object
- - org.apache.hadoop.mapreduce.TaskCompletionEvent
  - - org.apache.hadoop.mapred.TaskCompletionEvent

- All Implemented Interfaces:
    org.apache.hadoop.io.Writable

      @InterfaceAudience.Public
       @InterfaceStability.Stable
      public class TaskCompletionEvent
      extends TaskCompletionEvent

  This is used to track task completion events on job tracker.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TaskCompletionEvent.Status`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TaskCompletionEvent[]` | `EMPTY_ARRAY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskCompletionEvent()` Default constructor for Writable.
    `TaskCompletionEvent(int eventId, TaskAttemptID taskId, int idWithinJob, boolean isMap, TaskCompletionEvent.Status status, String taskTrackerHttp)` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TaskCompletionEvent` | `downgrade(TaskCompletionEvent event)`
    `TaskAttemptID` | `getTaskAttemptId()` Returns task id.
    `String` | `getTaskId()` Deprecated. use `getTaskAttemptId()` instead.
    `TaskCompletionEvent.Status` | `getTaskStatus()` Returns `TaskCompletionEvent.Status`
    `void` | `setEventId(int eventId)` set event Id.
    `protected void` | `setTaskAttemptId(TaskAttemptID taskId)` Sets task id.
    `void` | `setTaskId(String taskId)` Deprecated. use `setTaskAttemptId(TaskAttemptID)` instead.
    `void` | `setTaskID(TaskAttemptID taskId)` Deprecated. use `setTaskAttemptId(TaskAttemptID)` instead.
    `void` | `setTaskRunTime(int taskCompletionTime)` Set the task completion time
    `void` | `setTaskStatus(TaskCompletionEvent.Status status)` Set task status.
    `void` | `setTaskTrackerHttp(String taskTrackerHttp)` Set task tracker http location.

    - ### Methods inherited from class org.apache.hadoop.mapreduce.TaskCompletionEvent

      `equals, getEventId, getStatus, getTaskRunTime, getTaskTrackerHttp, hashCode, idWithinJob, isMapTask, readFields, setTaskAttemptId, setTaskStatus, toString, write`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY_ARRAY

          public static final TaskCompletionEvent[] EMPTY_ARRAY

  - ### Constructor Detail

    - #### TaskCompletionEvent

          public TaskCompletionEvent()

      Default constructor for Writable.

    - #### TaskCompletionEvent

          public TaskCompletionEvent(int eventId,
                                     TaskAttemptID taskId,
                                     int idWithinJob,
                                     boolean isMap,
                                     TaskCompletionEvent.Status status,
                                     String taskTrackerHttp)

      Constructor. eventId should be created externally and incremented per event for each job.
      Parameters:
        `eventId` - event id, event id should be unique and assigned in incrementally, starting from 0.
        `taskId` - task id
        `status` - task's status
        `taskTrackerHttp` - task tracker's host:port for http.

  - ### Method Detail

    - #### downgrade

          @InterfaceAudience.Private
          public static TaskCompletionEvent downgrade(TaskCompletionEvent event)

    - #### getTaskId

          @Deprecated
          public String getTaskId()

      Deprecated. use `getTaskAttemptId()` instead.
      Returns task id.
      Returns:
        task id

    - #### getTaskAttemptId

          public TaskAttemptID getTaskAttemptId()

      Returns task id.
      Overrides:
        `getTaskAttemptId` in class `TaskCompletionEvent`
      Returns:
        task id

    - #### getTaskStatus

          public TaskCompletionEvent.Status getTaskStatus()

      Returns `TaskCompletionEvent.Status`
      Returns:
        task completion status

    - #### setTaskId

          @Deprecated
          public void setTaskId(String taskId)

      Deprecated. use `setTaskAttemptId(TaskAttemptID)` instead.
      Sets task id.
      Parameters:
        `taskId` -

    - #### setTaskID

          @Deprecated
          public void setTaskID(TaskAttemptID taskId)

      Deprecated. use `setTaskAttemptId(TaskAttemptID)` instead.
      Sets task id.
      Parameters:
        `taskId` -

    - #### setTaskAttemptId

          protected void setTaskAttemptId(TaskAttemptID taskId)

      Sets task id.
      Parameters:
        `taskId` -

    - #### setTaskStatus

          @InterfaceAudience.Private
          public void setTaskStatus(TaskCompletionEvent.Status status)

      Set task status.
      Parameters:
        `status` -

    - #### setTaskRunTime

          @InterfaceAudience.Private
          public void setTaskRunTime(int taskCompletionTime)

      Set the task completion time
      Overrides:
        `setTaskRunTime` in class `TaskCompletionEvent`
      Parameters:
        `taskCompletionTime` - time (in millisec) the task took to complete

    - #### setEventId

          @InterfaceAudience.Private
          public void setEventId(int eventId)

      set event Id. should be assigned incrementally starting from 0.
      Overrides:
        `setEventId` in class `TaskCompletionEvent`
      Parameters:
        `eventId` -

    - #### setTaskTrackerHttp

          @InterfaceAudience.Private
          public void setTaskTrackerHttp(String taskTrackerHttp)

      Set task tracker http location.
      Overrides:
        `setTaskTrackerHttp` in class `TaskCompletionEvent`
      Parameters:
        `taskTrackerHttp` -

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