org.apache.tez.dag.app.dag.impl
Class TaskAttemptImpl

java.lang.Object
  extended by org.apache.tez.dag.app.dag.impl.TaskAttemptImpl
All Implemented Interfaces:
org.apache.hadoop.yarn.event.EventHandler<TaskAttemptEvent>, TaskAttempt

public class TaskAttemptImpl
extends Object
implements TaskAttempt, org.apache.hadoop.yarn.event.EventHandler<TaskAttemptEvent>


Nested Class Summary
protected static class TaskAttemptImpl.ContainerCompletedBeforeRunningTransition
           
protected static class TaskAttemptImpl.ContainerCompletedWhileRunningTransition
           
protected static class TaskAttemptImpl.ContainerCompletedWhileTerminating
           
protected static class TaskAttemptImpl.ContainerTerminatingBeforeRunningTransition
           
protected static class TaskAttemptImpl.DiagnosticInformationUpdater
           
protected static class TaskAttemptImpl.FailedTransitionHelper
           
protected static class TaskAttemptImpl.KilledTransitionHelper
           
protected static class TaskAttemptImpl.NodeFailedBeforeRunningTransition
           
protected static class TaskAttemptImpl.OutputConsumableTransition
           
protected static class TaskAttemptImpl.OutputReportedFailedTransition
           
protected static class TaskAttemptImpl.RecoverTransition
           
protected static class TaskAttemptImpl.ScheduleTaskattemptTransition
           
protected static class TaskAttemptImpl.StartedTransition
           
protected static class TaskAttemptImpl.StatusUpdaterTransition
           
protected static class TaskAttemptImpl.SucceededTransition
           
protected static class TaskAttemptImpl.TerminatedAfterSuccessHelper
           
protected static class TaskAttemptImpl.TerminatedAfterSuccessTransition
           
protected static class TaskAttemptImpl.TerminatedBeforeRunningTransition
           
protected static interface TaskAttemptImpl.TerminatedTransitionHelper
           
protected static class TaskAttemptImpl.TerminatedWhileRunningTransition
           
protected static class TaskAttemptImpl.TerminateTransition
           
 
Nested classes/interfaces inherited from interface org.apache.tez.dag.app.dag.TaskAttempt
TaskAttempt.TaskAttemptStatus
 
Field Summary
protected  AppContext appContext
           
protected  org.apache.hadoop.conf.Configuration conf
           
protected  org.apache.hadoop.yarn.event.EventHandler eventHandler
           
protected static TaskAttemptImpl.FailedTransitionHelper FAILED_HELPER
           
protected  boolean isRescheduled
           
protected static TaskAttemptImpl.KilledTransitionHelper KILLED_HELPER
           
protected  org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint locationHint
           
 
Constructor Summary
TaskAttemptImpl(org.apache.tez.dag.records.TezTaskID taskId, int attemptNumber, org.apache.hadoop.yarn.event.EventHandler eventHandler, TaskAttemptListener taskAttemptListener, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.util.Clock clock, TaskHeartbeatHandler taskHeartbeatHandler, AppContext appContext, org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint locationHint, boolean isRescheduled, org.apache.hadoop.yarn.api.records.Resource resource, ContainerContext containerContext, boolean leafVertex)
           
 
Method Summary
 org.apache.hadoop.yarn.api.records.ContainerId getAssignedContainerID()
           
 String getAssignedContainerMgrAddress()
           
 org.apache.tez.common.counters.TezCounters getCounters()
           
 org.apache.tez.dag.records.TezDAGID getDAGID()
           
 List<String> getDiagnostics()
           
 long getFinishTime()
           
 org.apache.tez.dag.records.TezTaskAttemptID getID()
           
 TaskAttemptStateInternal getInternalState()
           
 boolean getIsRescheduled()
           
 long getLaunchTime()
           
 String getNodeHttpAddress()
          If container Assigned then return the node's address, otherwise null.
 org.apache.hadoop.yarn.api.records.NodeId getNodeId()
           
 String getNodeRackName()
          If container Assigned then return the node's rackname, otherwise null.
 float getProgress()
           
 TaskAttemptReport getReport()
           
 TaskAttemptState getState()
           
 TaskAttemptState getStateNoLock()
           
 Task getTask()
           
 org.apache.tez.dag.records.TezTaskID getTaskID()
           
 org.apache.tez.dag.records.TezVertexID getVertexID()
           
 void handle(TaskAttemptEvent event)
           
 boolean isFinished()
          Has attempt reached the final state or not.
protected  void logJobHistoryAttemptFinishedEvent(TaskAttemptStateInternal state)
           
protected  void logJobHistoryAttemptStarted()
           
protected  void logJobHistoryAttemptUnsuccesfulCompletion(TaskAttemptState state)
           
protected  String[] resolveHosts(String[] src)
           
 TaskAttemptState restoreFromEvent(HistoryEvent historyEvent)
           
protected  void sendInputFailedToConsumers()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

conf

protected final org.apache.hadoop.conf.Configuration conf

eventHandler

protected org.apache.hadoop.yarn.event.EventHandler eventHandler

appContext

protected final AppContext appContext

locationHint

protected final org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint locationHint

isRescheduled

protected final boolean isRescheduled

FAILED_HELPER

protected static final TaskAttemptImpl.FailedTransitionHelper FAILED_HELPER

KILLED_HELPER

protected static final TaskAttemptImpl.KilledTransitionHelper KILLED_HELPER
Constructor Detail

TaskAttemptImpl

public TaskAttemptImpl(org.apache.tez.dag.records.TezTaskID taskId,
                       int attemptNumber,
                       org.apache.hadoop.yarn.event.EventHandler eventHandler,
                       TaskAttemptListener taskAttemptListener,
                       org.apache.hadoop.conf.Configuration conf,
                       org.apache.hadoop.yarn.util.Clock clock,
                       TaskHeartbeatHandler taskHeartbeatHandler,
                       AppContext appContext,
                       org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint locationHint,
                       boolean isRescheduled,
                       org.apache.hadoop.yarn.api.records.Resource resource,
                       ContainerContext containerContext,
                       boolean leafVertex)
Method Detail

getID

public org.apache.tez.dag.records.TezTaskAttemptID getID()
Specified by:
getID in interface TaskAttempt

getTaskID

public org.apache.tez.dag.records.TezTaskID getTaskID()
Specified by:
getTaskID in interface TaskAttempt

getVertexID

public org.apache.tez.dag.records.TezVertexID getVertexID()
Specified by:
getVertexID in interface TaskAttempt

getDAGID

public org.apache.tez.dag.records.TezDAGID getDAGID()
Specified by:
getDAGID in interface TaskAttempt

getReport

public TaskAttemptReport getReport()
Specified by:
getReport in interface TaskAttempt

getDiagnostics

public List<String> getDiagnostics()
Specified by:
getDiagnostics in interface TaskAttempt

getCounters

public org.apache.tez.common.counters.TezCounters getCounters()
Specified by:
getCounters in interface TaskAttempt

getProgress

public float getProgress()
Specified by:
getProgress in interface TaskAttempt

getState

public TaskAttemptState getState()
Specified by:
getState in interface TaskAttempt

getStateNoLock

public TaskAttemptState getStateNoLock()
Specified by:
getStateNoLock in interface TaskAttempt

isFinished

public boolean isFinished()
Description copied from interface: TaskAttempt
Has attempt reached the final state or not.

Specified by:
isFinished in interface TaskAttempt
Returns:
true if it has finished, else false

getAssignedContainerID

public org.apache.hadoop.yarn.api.records.ContainerId getAssignedContainerID()
Specified by:
getAssignedContainerID in interface TaskAttempt
Returns:
the container ID if a container is assigned, otherwise null.

getAssignedContainerMgrAddress

public String getAssignedContainerMgrAddress()
Specified by:
getAssignedContainerMgrAddress in interface TaskAttempt
Returns:
container mgr address if a container is assigned, otherwise null.

getNodeId

public org.apache.hadoop.yarn.api.records.NodeId getNodeId()
Specified by:
getNodeId in interface TaskAttempt
Returns:
node's id if a container is assigned, otherwise null.

getNodeHttpAddress

public String getNodeHttpAddress()
If container Assigned then return the node's address, otherwise null.

Specified by:
getNodeHttpAddress in interface TaskAttempt
Returns:
node's http address if a container is assigned, otherwise null.

getNodeRackName

public String getNodeRackName()
If container Assigned then return the node's rackname, otherwise null.

Specified by:
getNodeRackName in interface TaskAttempt
Returns:
node's rack name if a container is assigned, otherwise null.

getLaunchTime

public long getLaunchTime()
Specified by:
getLaunchTime in interface TaskAttempt
Returns:
time at which container is launched. If container is not launched yet, returns 0.

getFinishTime

public long getFinishTime()
Specified by:
getFinishTime in interface TaskAttempt
Returns:
attempt's finish time. If attempt is not finished yet, returns 0.

getTask

public Task getTask()
Specified by:
getTask in interface TaskAttempt

handle

public void handle(TaskAttemptEvent event)
Specified by:
handle in interface org.apache.hadoop.yarn.event.EventHandler<TaskAttemptEvent>

getInternalState

public TaskAttemptStateInternal getInternalState()

getIsRescheduled

public boolean getIsRescheduled()
Specified by:
getIsRescheduled in interface TaskAttempt

restoreFromEvent

public TaskAttemptState restoreFromEvent(HistoryEvent historyEvent)
Specified by:
restoreFromEvent in interface TaskAttempt

resolveHosts

protected String[] resolveHosts(String[] src)

logJobHistoryAttemptStarted

protected void logJobHistoryAttemptStarted()

logJobHistoryAttemptFinishedEvent

protected void logJobHistoryAttemptFinishedEvent(TaskAttemptStateInternal state)

logJobHistoryAttemptUnsuccesfulCompletion

protected void logJobHistoryAttemptUnsuccesfulCompletion(TaskAttemptState state)

sendInputFailedToConsumers

protected void sendInputFailedToConsumers()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014 Apache Software Foundation. All rights reserved.