Class ApplicationMasterService
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.resourcemanager.ApplicationMasterService
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service,org.apache.hadoop.yarn.api.ApplicationMasterProtocol
- Direct Known Subclasses:
OpportunisticContainerAllocatorAMService
@Private
public class ApplicationMasterService
extends org.apache.hadoop.service.AbstractService
implements org.apache.hadoop.yarn.api.ApplicationMasterProtocol
-
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 static final Allocationprotected InetSocketAddressprotected final org.apache.hadoop.yarn.factories.RecordFactoryprotected final RMContextprotected org.apache.hadoop.ipc.Server -
Constructor Summary
ConstructorsConstructorDescriptionApplicationMasterService(String name, RMContext rmContext, YarnScheduler scheduler) ApplicationMasterService(RMContext rmContext, YarnScheduler scheduler) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.api.protocolrecords.AllocateResponseallocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request) org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponsefinishApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request) protected org.apache.hadoop.yarn.server.resourcemanager.AMSProcessingChainprotected List<org.apache.hadoop.yarn.ams.ApplicationMasterServiceProcessor>getProcessorList(org.apache.hadoop.conf.Configuration conf) org.apache.hadoop.ipc.Serverprotected org.apache.hadoop.ipc.ServergetServer(org.apache.hadoop.yarn.ipc.YarnRPC rpc, org.apache.hadoop.conf.Configuration serverConf, InetSocketAddress addr, AMRMTokenSecretManager secretManager) booleanhasApplicationMasterRegistered(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) voidrefreshServiceAcls(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.security.authorize.PolicyProvider policyProvider) voidregisterAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponseregisterApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request) protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) protected voidprotected voidprotected booleansetAttemptLastResponseId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, int lastResponseId) voidunregisterAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) Methods 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
-
masterServiceAddress
-
server
protected org.apache.hadoop.ipc.Server server -
recordFactory
protected final org.apache.hadoop.yarn.factories.RecordFactory recordFactory -
rmContext
-
EMPTY_ALLOCATION
-
-
Constructor Details
-
ApplicationMasterService
-
ApplicationMasterService
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
getProcessorList
protected List<org.apache.hadoop.yarn.ams.ApplicationMasterServiceProcessor> getProcessorList(org.apache.hadoop.conf.Configuration conf) -
serviceStart
- Overrides:
serviceStartin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
getServer
protected org.apache.hadoop.ipc.Server getServer(org.apache.hadoop.yarn.ipc.YarnRPC rpc, org.apache.hadoop.conf.Configuration serverConf, InetSocketAddress addr, AMRMTokenSecretManager secretManager) -
getProcessingChain
protected org.apache.hadoop.yarn.server.resourcemanager.AMSProcessingChain getProcessingChain() -
getBindAddress
-
registerApplicationMaster
public org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException - Specified by:
registerApplicationMasterin interfaceorg.apache.hadoop.yarn.api.ApplicationMasterProtocol- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
finishApplicationMaster
public org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finishApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException - Specified by:
finishApplicationMasterin interfaceorg.apache.hadoop.yarn.api.ApplicationMasterProtocol- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
hasApplicationMasterRegistered
public boolean hasApplicationMasterRegistered(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) - Parameters:
appAttemptId-- Returns:
- true if application is registered for the respective attemptid
-
allocate
public org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException - Specified by:
allocatein interfaceorg.apache.hadoop.yarn.api.ApplicationMasterProtocol- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
registerAppAttempt
public void registerAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) -
setAttemptLastResponseId
@VisibleForTesting protected boolean setAttemptLastResponseId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, int lastResponseId) -
unregisterAttempt
public void unregisterAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) -
refreshServiceAcls
public void refreshServiceAcls(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.security.authorize.PolicyProvider policyProvider) -
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
getServer
@VisibleForTesting public org.apache.hadoop.ipc.Server getServer()
-