org.apache.hadoop.mapred
Class TaskAttemptListenerImpl
java.lang.Object
org.apache.hadoop.yarn.service.AbstractService
org.apache.hadoop.yarn.service.CompositeService
org.apache.hadoop.mapred.TaskAttemptListenerImpl
- All Implemented Interfaces:
- org.apache.hadoop.ipc.VersionedProtocol, org.apache.hadoop.mapred.TaskUmbilicalProtocol, TaskAttemptListener, org.apache.hadoop.yarn.service.Service
public class TaskAttemptListenerImpl
- extends org.apache.hadoop.yarn.service.CompositeService
- implements org.apache.hadoop.mapred.TaskUmbilicalProtocol, TaskAttemptListener
This class is responsible for talking to the task umblical.
It also converts all the old data structures
to yarn data structures.
This class HAS to be in this package to access package private
methods/classes.
| Nested classes/interfaces inherited from class org.apache.hadoop.yarn.service.CompositeService |
org.apache.hadoop.yarn.service.CompositeService.CompositeServiceShutdownHook |
| Nested classes/interfaces inherited from interface org.apache.hadoop.yarn.service.Service |
org.apache.hadoop.yarn.service.Service.STATE |
| Fields inherited from interface org.apache.hadoop.mapred.TaskUmbilicalProtocol |
versionID |
|
Method Summary |
boolean |
canCommit(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID)
Child checking whether it can commit. |
void |
commitPending(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
org.apache.hadoop.mapred.TaskStatus taskStatsu)
TaskAttempt is reporting that it is in commit_pending and it is waiting for
the commit Response
Commit it a two-phased protocol. |
void |
done(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID)
|
void |
fatalError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
String msg)
|
void |
fsError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
String message)
|
InetSocketAddress |
getAddress()
|
org.apache.hadoop.mapred.MapTaskCompletionEventsUpdate |
getMapCompletionEvents(org.apache.hadoop.mapred.JobID jobIdentifier,
int startIndex,
int maxEvents,
org.apache.hadoop.mapred.TaskAttemptID taskAttemptID)
|
org.apache.hadoop.ipc.ProtocolSignature |
getProtocolSignature(String protocol,
long clientVersion,
int clientMethodsHash)
|
long |
getProtocolVersion(String arg0,
long arg1)
|
org.apache.hadoop.mapred.JvmTask |
getTask(org.apache.hadoop.mapred.JvmContext context)
|
void |
init(org.apache.hadoop.conf.Configuration conf)
|
boolean |
ping(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID)
|
protected void |
registerHeartbeatHandler(org.apache.hadoop.conf.Configuration conf)
|
void |
registerLaunchedTask(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID,
WrappedJvmID jvmId)
Register task attempt. |
void |
registerPendingTask(org.apache.hadoop.mapred.Task task,
WrappedJvmID jvmID)
Register a JVM with the listener. |
void |
reportDiagnosticInfo(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
String diagnosticInfo)
|
void |
reportNextRecordRange(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
org.apache.hadoop.mapred.SortedRanges.Range range)
|
void |
shuffleError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
String message)
|
void |
start()
|
protected void |
startRpcServer()
|
boolean |
statusUpdate(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
org.apache.hadoop.mapred.TaskStatus taskStatus)
|
void |
stop()
|
protected void |
stopRpcServer()
|
void |
unregister(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID,
WrappedJvmID jvmID)
Unregister the JVM and the attempt associated with it. |
| Methods inherited from class org.apache.hadoop.yarn.service.CompositeService |
addService, getServices, removeService |
| Methods inherited from class org.apache.hadoop.yarn.service.AbstractService |
getConfig, getName, getServiceState, getStartTime, register, unregister |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
taskHeartbeatHandler
protected TaskHeartbeatHandler taskHeartbeatHandler
TaskAttemptListenerImpl
public TaskAttemptListenerImpl(AppContext context,
org.apache.hadoop.mapreduce.security.token.JobTokenSecretManager jobTokenSecretManager,
RMHeartbeatHandler rmHeartbeatHandler)
init
public void init(org.apache.hadoop.conf.Configuration conf)
- Specified by:
init in interface org.apache.hadoop.yarn.service.Service- Overrides:
init in class org.apache.hadoop.yarn.service.CompositeService
start
public void start()
- Specified by:
start in interface org.apache.hadoop.yarn.service.Service- Overrides:
start in class org.apache.hadoop.yarn.service.CompositeService
registerHeartbeatHandler
protected void registerHeartbeatHandler(org.apache.hadoop.conf.Configuration conf)
startRpcServer
protected void startRpcServer()
stop
public void stop()
- Specified by:
stop in interface org.apache.hadoop.yarn.service.Service- Overrides:
stop in class org.apache.hadoop.yarn.service.CompositeService
stopRpcServer
protected void stopRpcServer()
getAddress
public InetSocketAddress getAddress()
- Specified by:
getAddress in interface TaskAttemptListener
canCommit
public boolean canCommit(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID)
throws IOException
- Child checking whether it can commit.
Commit is a two-phased protocol. First the attempt informs the
ApplicationMaster that it is
commitPending(TaskAttemptID, TaskStatus). Then it repeatedly polls
the ApplicationMaster whether it canCommit(TaskAttemptID) This is
a legacy from the centralized commit protocol handling by the JobTracker.
- Specified by:
canCommit in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
commitPending
public void commitPending(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
org.apache.hadoop.mapred.TaskStatus taskStatsu)
throws IOException,
InterruptedException
- TaskAttempt is reporting that it is in commit_pending and it is waiting for
the commit Response
Commit it a two-phased protocol. First the attempt informs the
ApplicationMaster that it is
commitPending(TaskAttemptID, TaskStatus). Then it repeatedly polls
the ApplicationMaster whether it canCommit(TaskAttemptID) This is
a legacy from the centralized commit protocol handling by the JobTracker.
- Specified by:
commitPending in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
InterruptedException
done
public void done(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID)
throws IOException
- Specified by:
done in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
fatalError
public void fatalError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
String msg)
throws IOException
- Specified by:
fatalError in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
fsError
public void fsError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
String message)
throws IOException
- Specified by:
fsError in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
shuffleError
public void shuffleError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
String message)
throws IOException
- Specified by:
shuffleError in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
getMapCompletionEvents
public org.apache.hadoop.mapred.MapTaskCompletionEventsUpdate getMapCompletionEvents(org.apache.hadoop.mapred.JobID jobIdentifier,
int startIndex,
int maxEvents,
org.apache.hadoop.mapred.TaskAttemptID taskAttemptID)
throws IOException
- Specified by:
getMapCompletionEvents in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
ping
public boolean ping(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID)
throws IOException
- Specified by:
ping in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
reportDiagnosticInfo
public void reportDiagnosticInfo(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
String diagnosticInfo)
throws IOException
- Specified by:
reportDiagnosticInfo in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
statusUpdate
public boolean statusUpdate(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
org.apache.hadoop.mapred.TaskStatus taskStatus)
throws IOException,
InterruptedException
- Specified by:
statusUpdate in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
InterruptedException
getProtocolVersion
public long getProtocolVersion(String arg0,
long arg1)
throws IOException
- Specified by:
getProtocolVersion in interface org.apache.hadoop.ipc.VersionedProtocol
- Throws:
IOException
reportNextRecordRange
public void reportNextRecordRange(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID,
org.apache.hadoop.mapred.SortedRanges.Range range)
throws IOException
- Specified by:
reportNextRecordRange in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
getTask
public org.apache.hadoop.mapred.JvmTask getTask(org.apache.hadoop.mapred.JvmContext context)
throws IOException
- Specified by:
getTask in interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
- Throws:
IOException
registerPendingTask
public void registerPendingTask(org.apache.hadoop.mapred.Task task,
WrappedJvmID jvmID)
- Description copied from interface:
TaskAttemptListener
- Register a JVM with the listener. This should be called as soon as a
JVM ID is assigned to a task attempt, before it has been launched.
- Specified by:
registerPendingTask in interface TaskAttemptListener
- Parameters:
task - the task itself for this JVM.jvmID - The ID of the JVM .
registerLaunchedTask
public void registerLaunchedTask(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID,
WrappedJvmID jvmId)
- Description copied from interface:
TaskAttemptListener
- Register task attempt. This should be called when the JVM has been
launched.
- Specified by:
registerLaunchedTask in interface TaskAttemptListener
- Parameters:
attemptID - the id of the attempt for this JVM.jvmId - the ID of the JVM.
unregister
public void unregister(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID,
WrappedJvmID jvmID)
- Description copied from interface:
TaskAttemptListener
- Unregister the JVM and the attempt associated with it. This should be
called when the attempt/JVM has finished executing and is being cleaned up.
- Specified by:
unregister in interface TaskAttemptListener
- Parameters:
attemptID - the ID of the attempt.jvmID - the ID of the JVM for that attempt.
getProtocolSignature
public org.apache.hadoop.ipc.ProtocolSignature getProtocolSignature(String protocol,
long clientVersion,
int clientMethodsHash)
throws IOException
- Specified by:
getProtocolSignature in interface org.apache.hadoop.ipc.VersionedProtocol
- Throws:
IOException
Copyright © 2013 Apache Software Foundation. All Rights Reserved.