public class ContainerManagerImpl extends CompositeService implements ServiceStateChangeListener, ContainerManagementProtocol, EventHandler<ContainerManagerEvent>
CompositeService.CompositeServiceShutdownHookService.STATE| Modifier and Type | Field and Description |
|---|---|
protected LocalDirsHandlerService |
dirsHandler |
protected AsyncDispatcher |
dispatcher |
STOP_ONLY_STARTED_SERVICES| Constructor and Description |
|---|
ContainerManagerImpl(Context context,
ContainerExecutor exec,
DeletionService deletionContext,
NodeStatusUpdater nodeStatusUpdater,
NodeManagerMetrics metrics,
ApplicationACLsManager aclsManager,
LocalDirsHandlerService dirsHandler) |
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 LocalDirsHandlerService dirsHandler
protected final AsyncDispatcher dispatcher
public ContainerManagerImpl(Context context, ContainerExecutor exec, DeletionService deletionContext, NodeStatusUpdater nodeStatusUpdater, NodeManagerMetrics metrics, ApplicationACLsManager aclsManager, LocalDirsHandlerService dirsHandler)
public 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 LogHandler createLogHandler(Configuration conf, Context context, DeletionService deletionService)
public ContainersMonitor getContainersMonitor()
protected ResourceLocalizationService createResourceLocalizationService(ContainerExecutor exec, DeletionService deletionContext)
protected ContainersLauncher createContainersLauncher(Context context, ContainerExecutor exec)
protected void serviceStart()
throws Exception
AbstractServiceAbstractService.start() prevents re-entrancy.serviceStart in class CompositeServiceException - if needed -these will be caught,
wrapped, and trigger a service stoppublic 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.public void cleanUpApplicationsOnNMShutDown()
public void cleanupContainersOnNMResync()
protected UserGroupInformation getRemoteUgi() throws YarnException
YarnException@InterfaceAudience.Private protected NMTokenIdentifier selectNMTokenIdentifier(UserGroupInformation remoteUgi)
protected void authorizeUser(UserGroupInformation remoteUgi, NMTokenIdentifier nmTokenIdentifier) throws YarnException
YarnException@InterfaceAudience.Private protected void authorizeStartRequest(NMTokenIdentifier nmTokenIdentifier, ContainerTokenIdentifier containerTokenIdentifier) throws YarnException
containerTokenIdentifier - of the container to be startedYarnExceptionpublic StartContainersResponse startContainers(StartContainersRequest requests) throws YarnException, IOException
startContainers in interface ContainerManagementProtocolrequests - request to start a list of containersYarnExceptionNMNotYetReadyException - This exception is thrown when NM starts from scratch but has not
yet connected with RM.IOExceptionprotected ContainerTokenIdentifier verifyAndGetContainerTokenIdentifier(Token token, ContainerTokenIdentifier containerTokenIdentifier) throws YarnException, SecretManager.InvalidToken
@InterfaceAudience.Private protected void updateNMTokenIdentifier(NMTokenIdentifier nmTokenIdentifier) throws SecretManager.InvalidToken
SecretManager.InvalidTokenpublic StopContainersResponse stopContainers(StopContainersRequest requests) throws YarnException, IOException
stopContainers in interface ContainerManagementProtocolrequests - request to stop a list of containersYarnExceptionIOExceptionpublic GetContainerStatusesResponse getContainerStatuses(GetContainerStatusesRequest request) throws YarnException, IOException
getContainerStatuses in interface ContainerManagementProtocolrequest - request to get ContainerStatuses of containers with
the specified ContainerIdsContainerStatus of the
successfully queried containers and a containerId-to-exception map
for failed requests.YarnExceptionIOException@InterfaceAudience.Private protected void authorizeGetAndStopContainerRequest(ContainerId containerId, Container container, boolean stopRequest, NMTokenIdentifier identifier) throws YarnException
YarnExceptionpublic void handle(ContainerManagerEvent event)
handle in interface EventHandler<ContainerManagerEvent>public void setBlockNewContainerRequests(boolean blockNewContainerRequests)
@InterfaceAudience.Private public boolean getBlockNewContainerRequestsStatus()
public void stateChanged(Service service)
ServiceStateChangeListenerstateChanged in interface ServiceStateChangeListenerservice - the service that has changed.public Context getContext()
public Map<String,ByteBuffer> getAuxServiceMetaData()
Copyright © 2013 Apache Software Foundation. All rights reserved.