public class TaskAttemptListenerImpl extends CompositeService implements TaskUmbilicalProtocol, TaskAttemptListener
CompositeService.CompositeServiceShutdownHookService.STATE| Modifier and Type | Field and Description |
|---|---|
protected TaskHeartbeatHandler |
taskHeartbeatHandler |
STOP_ONLY_STARTED_SERVICESversionID| Constructor and Description |
|---|
TaskAttemptListenerImpl(AppContext context,
JobTokenSecretManager jobTokenSecretManager,
RMHeartbeatHandler rmHeartbeatHandler) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCommit(TaskAttemptID taskAttemptID)
Child checking whether it can commit.
|
void |
commitPending(TaskAttemptID taskAttemptID,
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(TaskAttemptID taskAttemptID)
Report that the task is successfully completed.
|
void |
fatalError(TaskAttemptID taskAttemptID,
String msg)
Report that the task encounted a fatal error.
|
void |
fsError(TaskAttemptID taskAttemptID,
String message)
Report that the task encounted a local filesystem error.
|
InetSocketAddress |
getAddress() |
MapTaskCompletionEventsUpdate |
getMapCompletionEvents(JobID jobIdentifier,
int startIndex,
int maxEvents,
TaskAttemptID taskAttemptID)
Called by a reduce task to get the map output locations for finished maps.
|
ProtocolSignature |
getProtocolSignature(String protocol,
long clientVersion,
int clientMethodsHash)
Return protocol version corresponding to protocol interface.
|
long |
getProtocolVersion(String arg0,
long arg1)
Return protocol version corresponding to protocol interface.
|
JvmTask |
getTask(org.apache.hadoop.mapred.JvmContext context)
Called when a child task process starts, to get its task.
|
boolean |
ping(TaskAttemptID taskAttemptID)
Periodically called by child to check if parent is still alive.
|
protected void |
registerHeartbeatHandler(Configuration conf) |
void |
registerLaunchedTask(TaskAttemptId attemptID,
WrappedJvmID jvmId)
Register task attempt.
|
void |
registerPendingTask(Task task,
WrappedJvmID jvmID)
Register a JVM with the listener.
|
void |
reportDiagnosticInfo(TaskAttemptID taskAttemptID,
String diagnosticInfo)
Report error messages back to parent.
|
void |
reportNextRecordRange(TaskAttemptID taskAttemptID,
org.apache.hadoop.mapred.SortedRanges.Range range)
Report the record range which is going to process next by the Task.
|
protected void |
serviceInit(Configuration conf)
All initialization code needed by a service.
|
protected void |
serviceStart()
Actions called during the INITED to STARTED transition.
|
protected void |
serviceStop()
Actions called during the transition to the STOPPED state.
|
void |
shuffleError(TaskAttemptID taskAttemptID,
String message)
Report that a reduce-task couldn't shuffle map-outputs.
|
protected void |
startRpcServer() |
boolean |
statusUpdate(TaskAttemptID taskAttemptID,
TaskStatus taskStatus)
Report child's progress to parent.
|
protected void |
stopRpcServer() |
void |
unregister(TaskAttemptId attemptID,
WrappedJvmID jvmID)
Unregister the JVM and the attempt associated with it.
|
addIfService, addService, getServices, removeServiceclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected TaskHeartbeatHandler taskHeartbeatHandler
public TaskAttemptListenerImpl(AppContext context, JobTokenSecretManager jobTokenSecretManager, RMHeartbeatHandler rmHeartbeatHandler)
protected void serviceInit(Configuration conf) throws Exception
AbstractServiceAbstractService.init(Configuration) prevents re-entrancy.
The base implementation checks to see if the subclass has created
a new configuration instance, and if so, updates the base class valueserviceInit in class CompositeServiceconf - configurationException - on a failure -these will be caught,
possibly wrapped, and wil; trigger a service stopprotected void serviceStart()
throws Exception
AbstractServiceAbstractService.start() prevents re-entrancy.serviceStart in class CompositeServiceException - if needed -these will be caught,
wrapped, and trigger a service stopprotected void registerHeartbeatHandler(Configuration conf)
protected void startRpcServer()
protected void serviceStop()
throws Exception
AbstractServiceAbstractService.stop() prevents re-entrancy.
Implementations MUST write this to be robust against failures, including
checks for null references -and for the first failure to not stop other
attempts to shut down parts of the service.serviceStop in class CompositeServiceException - if needed -these will be caught and logged.protected void stopRpcServer()
public InetSocketAddress getAddress()
getAddress in interface TaskAttemptListenerpublic boolean canCommit(TaskAttemptID taskAttemptID) throws IOException
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.canCommit in interface TaskUmbilicalProtocolIOExceptionpublic void commitPending(TaskAttemptID taskAttemptID, TaskStatus taskStatsu) throws IOException, InterruptedException
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.commitPending in interface TaskUmbilicalProtocoltaskAttemptID - task's idtaskStatsu - status of the childIOExceptionInterruptedExceptionpublic void done(TaskAttemptID taskAttemptID) throws IOException
TaskUmbilicalProtocoldone in interface TaskUmbilicalProtocoltaskAttemptID - task's idIOExceptionpublic void fatalError(TaskAttemptID taskAttemptID, String msg) throws IOException
TaskUmbilicalProtocolfatalError in interface TaskUmbilicalProtocolIOExceptionpublic void fsError(TaskAttemptID taskAttemptID, String message) throws IOException
TaskUmbilicalProtocolfsError in interface TaskUmbilicalProtocolIOExceptionpublic void shuffleError(TaskAttemptID taskAttemptID, String message) throws IOException
TaskUmbilicalProtocolshuffleError in interface TaskUmbilicalProtocolIOExceptionpublic MapTaskCompletionEventsUpdate getMapCompletionEvents(JobID jobIdentifier, int startIndex, int maxEvents, TaskAttemptID taskAttemptID) throws IOException
TaskUmbilicalProtocolgetMapCompletionEvents in interface TaskUmbilicalProtocolstartIndex - the index starting from which the locations should be
fetchedmaxEvents - the max number of locations to fetchtaskAttemptID - The attempt id of the task that is trying to communicateMapTaskCompletionEventsUpdateIOExceptionpublic boolean ping(TaskAttemptID taskAttemptID) throws IOException
TaskUmbilicalProtocolping in interface TaskUmbilicalProtocolIOExceptionpublic void reportDiagnosticInfo(TaskAttemptID taskAttemptID, String diagnosticInfo) throws IOException
TaskUmbilicalProtocolreportDiagnosticInfo in interface TaskUmbilicalProtocoltaskAttemptID - the id of the task involveddiagnosticInfo - the text to reportIOExceptionpublic boolean statusUpdate(TaskAttemptID taskAttemptID, TaskStatus taskStatus) throws IOException, InterruptedException
TaskUmbilicalProtocolstatusUpdate in interface TaskUmbilicalProtocoltaskAttemptID - task-id of the childtaskStatus - status of the childIOExceptionInterruptedExceptionpublic long getProtocolVersion(String arg0, long arg1) throws IOException
VersionedProtocolgetProtocolVersion in interface VersionedProtocolarg0 - The classname of the protocol interfacearg1 - The version of the protocol that the client speaksIOException - if any IO error occurspublic void reportNextRecordRange(TaskAttemptID taskAttemptID, org.apache.hadoop.mapred.SortedRanges.Range range) throws IOException
TaskUmbilicalProtocolreportNextRecordRange in interface TaskUmbilicalProtocoltaskAttemptID - the id of the task involvedrange - the range of record sequence nosIOExceptionpublic JvmTask getTask(org.apache.hadoop.mapred.JvmContext context) throws IOException
TaskUmbilicalProtocolgetTask in interface TaskUmbilicalProtocolcontext - the JvmContext of the JVM w.r.t the TaskTracker that
launched itIOExceptionpublic void registerPendingTask(Task task, WrappedJvmID jvmID)
TaskAttemptListenerregisterPendingTask in interface TaskAttemptListenertask - the task itself for this JVM.jvmID - The ID of the JVM .public void registerLaunchedTask(TaskAttemptId attemptID, WrappedJvmID jvmId)
TaskAttemptListenerregisterLaunchedTask in interface TaskAttemptListenerattemptID - the id of the attempt for this JVM.jvmId - the ID of the JVM.public void unregister(TaskAttemptId attemptID, WrappedJvmID jvmID)
TaskAttemptListenerunregister in interface TaskAttemptListenerattemptID - the ID of the attempt.jvmID - the ID of the JVM for that attempt.public ProtocolSignature getProtocolSignature(String protocol, long clientVersion, int clientMethodsHash) throws IOException
VersionedProtocolgetProtocolSignature in interface VersionedProtocolprotocol - The classname of the protocol interfaceclientVersion - The version of the protocol that the client speaksclientMethodsHash - the hashcode of client protocol methodsIOExceptionfor a default implementationCopyright © 2013 Apache Software Foundation. All rights reserved.