org.apache.hadoop.mapreduce.v2.app.job.impl
Class TaskAttemptImpl
java.lang.Object
org.apache.hadoop.mapreduce.v2.app.job.impl.TaskAttemptImpl
- All Implemented Interfaces:
- TaskAttempt, org.apache.hadoop.yarn.event.EventHandler<TaskAttemptEvent>
- Direct Known Subclasses:
- MapTaskAttemptImpl, ReduceTaskAttemptImpl
public abstract class TaskAttemptImpl
- extends Object
- implements TaskAttempt, org.apache.hadoop.yarn.event.EventHandler<TaskAttemptEvent>
Implementation of TaskAttempt interface.
|
Constructor Summary |
TaskAttemptImpl(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId,
int i,
org.apache.hadoop.yarn.event.EventHandler eventHandler,
TaskAttemptListener taskAttemptListener,
org.apache.hadoop.fs.Path jobFile,
int partition,
org.apache.hadoop.mapred.JobConf conf,
String[] dataLocalHosts,
org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier> jobToken,
org.apache.hadoop.security.Credentials credentials,
org.apache.hadoop.yarn.util.Clock clock,
AppContext appContext)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
conf
protected final org.apache.hadoop.mapred.JobConf conf
jobFile
protected final org.apache.hadoop.fs.Path jobFile
partition
protected final int partition
eventHandler
protected org.apache.hadoop.yarn.event.EventHandler eventHandler
dataLocalHosts
protected Set<String> dataLocalHosts
dataLocalRacks
protected Set<String> dataLocalRacks
container
public org.apache.hadoop.yarn.api.records.Container container
TaskAttemptImpl
public TaskAttemptImpl(org.apache.hadoop.mapreduce.v2.api.records.TaskId taskId,
int i,
org.apache.hadoop.yarn.event.EventHandler eventHandler,
TaskAttemptListener taskAttemptListener,
org.apache.hadoop.fs.Path jobFile,
int partition,
org.apache.hadoop.mapred.JobConf conf,
String[] dataLocalHosts,
org.apache.hadoop.security.token.Token<org.apache.hadoop.mapreduce.security.token.JobTokenIdentifier> jobToken,
org.apache.hadoop.security.Credentials credentials,
org.apache.hadoop.yarn.util.Clock clock,
AppContext appContext)
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.
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.
getShuffleFinishTime
public long getShuffleFinishTime()
- Specified by:
getShuffleFinishTime in interface TaskAttempt
- Returns:
- The attempt's shuffle finish time if the attempt is a reduce. If
attempt is not finished yet, returns 0.
getSortFinishTime
public long getSortFinishTime()
- Specified by:
getSortFinishTime in interface TaskAttempt
- Returns:
- The attempt's sort or merge finish time if the attempt is a reduce.
If attempt is not finished yet, returns 0.
getShufflePort
public int getShufflePort()
- Specified by:
getShufflePort in interface TaskAttempt
- Returns:
- the port shuffle is on.
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.
createRemoteTask
protected abstract org.apache.hadoop.mapred.Task createRemoteTask()
getID
public org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId getID()
- Specified by:
getID 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
getReport
public org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptReport getReport()
- Specified by:
getReport in interface TaskAttempt
getDiagnostics
public List<String> getDiagnostics()
- Specified by:
getDiagnostics in interface TaskAttempt
getCounters
public org.apache.hadoop.mapreduce.Counters getCounters()
- Specified by:
getCounters in interface TaskAttempt
getProgress
public float getProgress()
- Specified by:
getProgress in interface TaskAttempt
getPhase
public org.apache.hadoop.mapreduce.v2.api.records.Phase getPhase()
- Specified by:
getPhase in interface TaskAttempt
getState
public org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptState getState()
- Specified by:
getState 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()
getLocality
public org.apache.hadoop.mapreduce.v2.api.records.Locality getLocality()
setLocality
public void setLocality(org.apache.hadoop.mapreduce.v2.api.records.Locality locality)
getAvataar
public org.apache.hadoop.mapreduce.v2.api.records.Avataar getAvataar()
setAvataar
public void setAvataar(org.apache.hadoop.mapreduce.v2.api.records.Avataar avataar)
recover
public TaskAttemptStateInternal recover(org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.TaskAttemptInfo taInfo,
org.apache.hadoop.mapreduce.OutputCommitter committer,
boolean recoverOutput)
resolveHosts
protected Set<String> resolveHosts(String[] src)
resolveHost
protected String resolveHost(String src)
isIP
protected boolean isIP(String src)
Copyright © 2014 Apache Software Foundation. All Rights Reserved.