Class Task

java.lang.Object
org.apache.drill.yarn.appMaster.Task

public class Task extends Object
AM-side state of individual containers. This class is mostly a holder of state. Behavior is provided by the TaskState subclasses.
  • Field Details

    • MAX_CANCELLATION_TIME

      public static final long MAX_CANCELLATION_TIME
      Maximum amount of time to wait when canceling a job in the REQUESTING state. YARN will happily wait forever for a resource, this setting allows the user to request to cancel a task, give YARN a while to respond, then forcibly cancel the job at timeout.
      See Also:
    • taskId

      public final int taskId
      Internal identifier for the task.
    • scheduler

      public final Scheduler scheduler
    • taskSpec

      public TaskSpec taskSpec
      Identifies the type of container needed and the details of the task to run.
    • taskGroup

      public SchedulerStateImpl taskGroup
      The scheduler group that manages this task.
    • trackingState

      protected Task.TrackingState trackingState
      Tracking state for an additional task tracker (such as using ZooKeeper to track Drill-bits.)
    • containerRequest

      public org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest containerRequest
      Tracks the container request between request and allocation. We must pass the container request back to YARN to remove it once it is allocated.
    • container

      public org.apache.hadoop.yarn.api.records.Container container
      The YARN container assigned to this task. The container is set only during the ALLOCATED, LAUNCHING, RUNNING and ENDING states.
    • state

      protected TaskState state
      Life-cycle state of this task.
    • cancelled

      protected boolean cancelled
      True if the application has requested that the resource request or application run be cancelled. Cancelled tasks are not subject to retry.
    • disposition

      public Task.Disposition disposition
      Disposition of a completed task: whether it was cancelled, succeeded or failed.
    • error

      public Throwable error
    • tryCount

      public int tryCount
    • completionStatus

      public org.apache.hadoop.yarn.api.records.ContainerStatus completionStatus
    • launchTime

      public long launchTime
    • stateStartTime

      public long stateStartTime
    • completionTime

      public long completionTime
    • properties

      public Map<String,Object> properties
  • Constructor Details

  • Method Details

    • resetTrackingState

      public void resetTrackingState()
    • getId

      public int getId()
    • getContainerSpec

      public ContainerRequestSpec getContainerSpec()
    • getLaunchSpec

      public LaunchSpec getLaunchSpec()
    • getState

      public TaskState getState()
    • getContainerId

      public org.apache.hadoop.yarn.api.records.ContainerId getContainerId()
    • getContainer

      public org.apache.hadoop.yarn.api.records.Container getContainer()
    • getTryCount

      public int getTryCount()
    • isFailed

      public boolean isFailed()
    • getDisposition

      public Task.Disposition getDisposition()
    • getGroup

      public SchedulerStateImpl getGroup()
    • setGroup

      public void setGroup(SchedulerStateImpl taskGroup)
    • retryable

      public boolean retryable()
    • isCancelled

      public boolean isCancelled()
    • reset

      public void reset()
      Reset the task state in preparation for a retry. Note: state reset is done by the state class.
    • uptime

      public long uptime()
    • getHostName

      public String getHostName()
    • getTrackingState

      public Task.TrackingState getTrackingState()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isLive

      public boolean isLive()
    • cancel

      public void cancel()
    • copy

      public Task copy()
    • getName

      public String getName()
    • getLabel

      public String getLabel()
      Label for this task displayed in log messages.
      Returns:
    • setTrackingState

      public void setTrackingState(Task.TrackingState tState)