Package org.apache.hadoop.mapred
Class TaskAttemptListenerImpl
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.mapred.TaskAttemptListenerImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.ipc.VersionedProtocol,org.apache.hadoop.mapred.TaskUmbilicalProtocol,TaskAttemptListener,org.apache.hadoop.service.Service
public class TaskAttemptListenerImpl
extends org.apache.hadoop.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 Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHookNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
FieldsFields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICESFields inherited from interface org.apache.hadoop.mapred.TaskUmbilicalProtocol
versionID -
Constructor Summary
ConstructorsConstructorDescriptionTaskAttemptListenerImpl(AppContext context, org.apache.hadoop.mapreduce.security.token.JobTokenSecretManager jobTokenSecretManager, RMHeartbeatHandler rmHeartbeatHandler, AMPreemptionPolicy preemptionPolicy) TaskAttemptListenerImpl(AppContext context, org.apache.hadoop.mapreduce.security.token.JobTokenSecretManager jobTokenSecretManager, RMHeartbeatHandler rmHeartbeatHandler, AMPreemptionPolicy preemptionPolicy, byte[] secretShuffleKey) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCommit(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID) Child checking whether it can commit.voidcommitPending(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.voiddone(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID) voidfatalError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, String msg, boolean fastFail) voidorg.apache.hadoop.mapreduce.checkpoint.TaskCheckpointIDgetCheckpointID(org.apache.hadoop.mapred.TaskID taskId) org.apache.hadoop.mapred.MapTaskCompletionEventsUpdategetMapCompletionEvents(org.apache.hadoop.mapred.JobID jobIdentifier, int startIndex, int maxEvents, org.apache.hadoop.mapred.TaskAttemptID taskAttemptID) org.apache.hadoop.ipc.ProtocolSignaturegetProtocolSignature(String protocol, long clientVersion, int clientMethodsHash) longgetProtocolVersion(String arg0, long arg1) org.apache.hadoop.mapred.JvmTaskgetTask(org.apache.hadoop.mapred.JvmContext context) voidpreempted(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, org.apache.hadoop.mapred.TaskStatus taskStatus) protected voidregisterHeartbeatHandler(org.apache.hadoop.conf.Configuration conf) voidregisterLaunchedTask(org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptID, WrappedJvmID jvmId) Register task attempt.voidregisterPendingTask(org.apache.hadoop.mapred.Task task, WrappedJvmID jvmID) Register a JVM with the listener.voidreportDiagnosticInfo(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, String diagnosticInfo) voidreportNextRecordRange(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, org.apache.hadoop.mapred.SortedRanges.Range range) protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) protected voidprotected voidvoidsetCheckpointID(org.apache.hadoop.mapred.TaskID taskId, org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID cid) voidshuffleError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, String message) protected voidorg.apache.hadoop.mapred.AMFeedbackstatusUpdate(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, org.apache.hadoop.mapred.TaskStatus taskStatus) protected voidvoidunregister(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.service.CompositeService
addIfService, addService, getServices, removeServiceMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
taskHeartbeatHandler
-
-
Constructor Details
-
TaskAttemptListenerImpl
public TaskAttemptListenerImpl(AppContext context, org.apache.hadoop.mapreduce.security.token.JobTokenSecretManager jobTokenSecretManager, RMHeartbeatHandler rmHeartbeatHandler, AMPreemptionPolicy preemptionPolicy) -
TaskAttemptListenerImpl
public TaskAttemptListenerImpl(AppContext context, org.apache.hadoop.mapreduce.security.token.JobTokenSecretManager jobTokenSecretManager, RMHeartbeatHandler rmHeartbeatHandler, AMPreemptionPolicy preemptionPolicy, byte[] secretShuffleKey)
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
serviceStart
- Overrides:
serviceStartin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
registerHeartbeatHandler
protected void registerHeartbeatHandler(org.apache.hadoop.conf.Configuration conf) -
startRpcServer
protected void startRpcServer() -
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
stopRpcServer
protected void stopRpcServer() -
getAddress
- Specified by:
getAddressin interfaceTaskAttemptListener
-
canCommit
Child checking whether it can commit.
Commit is a two-phased protocol. First the attempt informs the ApplicationMaster that it iscommitPending(TaskAttemptID, TaskStatus). Then it repeatedly polls the ApplicationMaster whether itcanCommit(TaskAttemptID)This is a legacy from the centralized commit protocol handling by the JobTracker.- Specified by:
canCommitin interfaceorg.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 iscommitPending(TaskAttemptID, TaskStatus). Then it repeatedly polls the ApplicationMaster whether itcanCommit(TaskAttemptID)This is a legacy from the centralized commit protocol handling by the JobTracker.- Specified by:
commitPendingin interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOExceptionInterruptedException
-
preempted
public void preempted(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, org.apache.hadoop.mapred.TaskStatus taskStatus) throws IOException, InterruptedException - Specified by:
preemptedin interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOExceptionInterruptedException
-
done
- Specified by:
donein interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOException
-
fatalError
public void fatalError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, String msg, boolean fastFail) throws IOException - Specified by:
fatalErrorin interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOException
-
fsError
public void fsError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, String message) throws IOException - Specified by:
fsErrorin interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOException
-
shuffleError
public void shuffleError(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, String message) throws IOException - Specified by:
shuffleErrorin interfaceorg.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:
getMapCompletionEventsin interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOException
-
reportDiagnosticInfo
public void reportDiagnosticInfo(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, String diagnosticInfo) throws IOException - Specified by:
reportDiagnosticInfoin interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOException
-
statusUpdate
public org.apache.hadoop.mapred.AMFeedback statusUpdate(org.apache.hadoop.mapred.TaskAttemptID taskAttemptID, org.apache.hadoop.mapred.TaskStatus taskStatus) throws IOException, InterruptedException - Specified by:
statusUpdatein interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOExceptionInterruptedException
-
getProtocolVersion
- Specified by:
getProtocolVersionin interfaceorg.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:
reportNextRecordRangein interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOException
-
getTask
public org.apache.hadoop.mapred.JvmTask getTask(org.apache.hadoop.mapred.JvmContext context) throws IOException - Specified by:
getTaskin interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol- Throws:
IOException
-
registerPendingTask
Description copied from interface:TaskAttemptListenerRegister 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:
registerPendingTaskin interfaceTaskAttemptListener- 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:TaskAttemptListenerRegister task attempt. This should be called when the JVM has been launched.- Specified by:
registerLaunchedTaskin interfaceTaskAttemptListener- 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:TaskAttemptListenerUnregister 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:
unregisterin interfaceTaskAttemptListener- 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:
getProtocolSignaturein interfaceorg.apache.hadoop.ipc.VersionedProtocol- Throws:
IOException
-
getCheckpointID
public org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID getCheckpointID(org.apache.hadoop.mapred.TaskID taskId) - Specified by:
getCheckpointIDin interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol
-
setCheckpointID
public void setCheckpointID(org.apache.hadoop.mapred.TaskID taskId, org.apache.hadoop.mapreduce.checkpoint.TaskCheckpointID cid) - Specified by:
setCheckpointIDin interfaceorg.apache.hadoop.mapred.TaskUmbilicalProtocol
-