Class RMCommunicator
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator
- All Implemented Interfaces:
Closeable,AutoCloseable,RMHeartbeatHandler,org.apache.hadoop.service.Service
- Direct Known Subclasses:
LocalContainerAllocator,RMContainerRequestor
public abstract class RMCommunicator
extends org.apache.hadoop.service.AbstractService
implements RMHeartbeatHandler
Registers/unregisters to RM and sends heartbeats to RM.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Threadprotected org.apache.hadoop.yarn.api.records.ApplicationIdprotected org.apache.hadoop.yarn.event.EventHandlerprotected booleanprotected org.apache.hadoop.yarn.api.ApplicationMasterProtocol -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.hadoop.yarn.api.ApplicationMasterProtocolprotected voidprotected floatGet the appProgress.protected AppContextprotected JobgetJob()longprotected org.apache.hadoop.yarn.api.records.ResourceEnumSet<org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes>protected abstract voidprotected booleanprotected voidregister()voidrunOnNextHeartbeat(Runnable callback) protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) protected voidprotected voidvoidsetShouldUnregister(boolean shouldUnregister) voidsetSignalled(boolean isSignalled) protected voidprotected voidMethods 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
-
applicationId
protected org.apache.hadoop.yarn.api.records.ApplicationId applicationId -
allocatorThread
-
eventHandler
protected org.apache.hadoop.yarn.event.EventHandler eventHandler -
scheduler
protected org.apache.hadoop.yarn.api.ApplicationMasterProtocol scheduler -
applicationACLs
-
isSignalled
protected volatile boolean isSignalled
-
-
Constructor Details
-
RMCommunicator
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
serviceStart
- Overrides:
serviceStartin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
getContext
-
getJob
-
getApplicationProgress
protected float getApplicationProgress()Get the appProgress. Can be used only after this component is started.- Returns:
- the appProgress.
-
register
protected void register() -
unregister
protected void unregister() -
doUnregistration
@VisibleForTesting protected void doUnregistration() throws org.apache.hadoop.yarn.exceptions.YarnException, IOException, InterruptedException- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOExceptionInterruptedException
-
getMaxContainerCapability
protected org.apache.hadoop.yarn.api.records.Resource getMaxContainerCapability() -
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
startAllocatorThread
protected void startAllocatorThread() -
createSchedulerProxy
protected org.apache.hadoop.yarn.api.ApplicationMasterProtocol createSchedulerProxy() -
heartbeat
- Throws:
Exception
-
getLastHeartbeatTime
public long getLastHeartbeatTime()- Specified by:
getLastHeartbeatTimein interfaceRMHeartbeatHandler
-
runOnNextHeartbeat
- Specified by:
runOnNextHeartbeatin interfaceRMHeartbeatHandler
-
setShouldUnregister
public void setShouldUnregister(boolean shouldUnregister) -
setSignalled
public void setSignalled(boolean isSignalled) -
isApplicationMasterRegistered
@VisibleForTesting protected boolean isApplicationMasterRegistered() -
getSchedulerResourceTypes
public EnumSet<org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes> getSchedulerResourceTypes()
-