public class ContainerManagerImpl extends org.apache.hadoop.service.CompositeService implements ContainerManager
Modifier and Type | Field and Description |
---|---|
protected boolean |
amrmProxyEnabled |
protected Context |
context |
protected LocalDirsHandlerService |
dirsHandler |
protected org.apache.hadoop.yarn.event.AsyncDispatcher |
dispatcher |
static String |
INVALID_NMTOKEN_MSG |
protected NodeStatusUpdater |
nodeStatusUpdater |
Constructor and Description |
---|
ContainerManagerImpl(Context context,
ContainerExecutor exec,
DeletionService deletionContext,
NodeStatusUpdater nodeStatusUpdater,
NodeManagerMetrics metrics,
LocalDirsHandlerService dirsHandler) |
Modifier and Type | Method and Description |
---|---|
protected void |
authorizeGetAndStopContainerRequest(org.apache.hadoop.yarn.api.records.ContainerId containerId,
Container container,
boolean stopRequest,
org.apache.hadoop.yarn.security.NMTokenIdentifier identifier,
String remoteUser) |
protected void |
authorizeStartAndResourceIncreaseRequest(org.apache.hadoop.yarn.security.NMTokenIdentifier nmTokenIdentifier,
org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier,
boolean startRequest) |
protected void |
authorizeUser(org.apache.hadoop.security.UserGroupInformation remoteUgi,
org.apache.hadoop.yarn.security.NMTokenIdentifier nmTokenIdentifier) |
void |
cleanUpApplicationsOnNMShutDown() |
void |
cleanupContainersOnNMResync() |
org.apache.hadoop.yarn.api.protocolrecords.CommitResponse |
commitLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Commit last reInitialization after which no rollback will be possible.
|
protected void |
createAMRMProxyService(org.apache.hadoop.conf.Configuration conf) |
protected org.apache.hadoop.yarn.event.EventHandler<ApplicationEvent> |
createApplicationEventDispatcher() |
protected ContainerScheduler |
createContainerScheduler(Context cntxt) |
protected AbstractContainersLauncher |
createContainersLauncher(Context ctxt,
ContainerExecutor exec) |
protected ContainersMonitor |
createContainersMonitor(ContainerExecutor exec) |
protected LogHandler |
createLogHandler(org.apache.hadoop.conf.Configuration conf,
Context context,
DeletionService deletionService) |
protected NMTimelinePublisher |
createNMTimelinePublisher(Context ctxt) |
protected ResourceLocalizationService |
createResourceLocalizationService(ContainerExecutor exec,
DeletionService deletionContext,
Context nmContext,
NodeManagerMetrics nmMetrics) |
protected SharedCacheUploadService |
createSharedCacheUploaderService() |
AMRMProxyService |
getAMRMProxyService() |
Map<String,ByteBuffer> |
getAuxServiceMetaData() |
ContainerScheduler |
getContainerScheduler() |
ContainersMonitor |
getContainersMonitor() |
org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusesResponse |
getContainerStatuses(org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusesRequest request)
Get a list of container statuses running on this NodeManager
|
protected org.apache.hadoop.yarn.api.records.ContainerStatus |
getContainerStatusInternal(org.apache.hadoop.yarn.api.records.ContainerId containerID,
org.apache.hadoop.yarn.security.NMTokenIdentifier nmTokenIdentifier,
String remoteUser) |
Context |
getContext() |
org.apache.hadoop.yarn.api.protocolrecords.GetLocalizationStatusesResponse |
getLocalizationStatuses(org.apache.hadoop.yarn.api.protocolrecords.GetLocalizationStatusesRequest request) |
org.apache.hadoop.yarn.server.api.records.OpportunisticContainersStatus |
getOpportunisticContainersStatus() |
protected org.apache.hadoop.security.UserGroupInformation |
getRemoteUgi() |
ResourceLocalizationService |
getResourceLocalizationService() |
void |
handle(ContainerManagerEvent event) |
void |
handleCredentialUpdate() |
org.apache.hadoop.yarn.api.protocolrecords.IncreaseContainersResourceResponse |
increaseContainersResource(org.apache.hadoop.yarn.api.protocolrecords.IncreaseContainersResourceRequest requests)
Deprecated.
|
protected boolean |
isServiceStopped() |
org.apache.hadoop.yarn.api.protocolrecords.ResourceLocalizationResponse |
localize(org.apache.hadoop.yarn.api.protocolrecords.ResourceLocalizationRequest request) |
protected void |
recoverActiveContainer(Application app,
org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext,
org.apache.hadoop.yarn.security.ContainerTokenIdentifier token,
NMStateStoreService.RecoveredContainerState rcs)
Recover a running container.
|
void |
reInitializeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.hadoop.yarn.api.records.ContainerLaunchContext reInitLaunchContext,
boolean autoCommit)
ReInitialize a container using a new Launch Context.
|
org.apache.hadoop.yarn.api.protocolrecords.ReInitializeContainerResponse |
reInitializeContainer(org.apache.hadoop.yarn.api.protocolrecords.ReInitializeContainerRequest request) |
org.apache.hadoop.yarn.api.protocolrecords.RestartContainerResponse |
restartContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) |
org.apache.hadoop.yarn.api.protocolrecords.RollbackResponse |
rollbackLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Rollback the last reInitialization, if possible.
|
protected org.apache.hadoop.yarn.security.NMTokenIdentifier |
selectNMTokenIdentifier(org.apache.hadoop.security.UserGroupInformation remoteUgi) |
void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
protected void |
serviceStart() |
void |
serviceStop() |
protected void |
setAMRMProxyService(AMRMProxyService amrmProxyService) |
org.apache.hadoop.yarn.api.protocolrecords.SignalContainerResponse |
signalToContainer(org.apache.hadoop.yarn.api.protocolrecords.SignalContainerRequest request) |
protected void |
startContainerInternal(org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier,
org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest request,
String remoteUser) |
org.apache.hadoop.yarn.api.protocolrecords.StartContainersResponse |
startContainers(org.apache.hadoop.yarn.api.protocolrecords.StartContainersRequest requests)
Start a list of containers on this NodeManager.
|
void |
stateChanged(org.apache.hadoop.service.Service service) |
protected void |
stopContainerInternal(org.apache.hadoop.yarn.api.records.ContainerId containerID,
String remoteUser) |
org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse |
stopContainers(org.apache.hadoop.yarn.api.protocolrecords.StopContainersRequest requests)
Stop a list of containers running on this NodeManager.
|
org.apache.hadoop.yarn.api.protocolrecords.ContainerUpdateResponse |
updateContainer(org.apache.hadoop.yarn.api.protocolrecords.ContainerUpdateRequest request)
Update resource of a list of containers on this NodeManager.
|
protected void |
updateNMTokenIdentifier(org.apache.hadoop.yarn.security.NMTokenIdentifier nmTokenIdentifier) |
void |
updateQueuingLimit(org.apache.hadoop.yarn.server.api.records.ContainerQueuingLimit queuingLimit) |
protected org.apache.hadoop.yarn.security.ContainerTokenIdentifier |
verifyAndGetContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.Token token,
org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier) |
addIfService, addService, getServices, removeService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public static final String INVALID_NMTOKEN_MSG
protected final Context context
protected final NodeStatusUpdater nodeStatusUpdater
protected LocalDirsHandlerService dirsHandler
protected final org.apache.hadoop.yarn.event.AsyncDispatcher dispatcher
protected boolean amrmProxyEnabled
public ContainerManagerImpl(Context context, ContainerExecutor exec, DeletionService deletionContext, NodeStatusUpdater nodeStatusUpdater, NodeManagerMetrics metrics, LocalDirsHandlerService dirsHandler)
public void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
serviceInit
in class org.apache.hadoop.service.CompositeService
Exception
protected void createAMRMProxyService(org.apache.hadoop.conf.Configuration conf)
protected ContainerScheduler createContainerScheduler(Context cntxt)
protected ContainersMonitor createContainersMonitor(ContainerExecutor exec)
protected void recoverActiveContainer(Application app, org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext, org.apache.hadoop.yarn.security.ContainerTokenIdentifier token, NMStateStoreService.RecoveredContainerState rcs) throws IOException
IOException
protected LogHandler createLogHandler(org.apache.hadoop.conf.Configuration conf, Context context, DeletionService deletionService)
public ContainersMonitor getContainersMonitor()
getContainersMonitor
in interface ContainerManager
protected ResourceLocalizationService createResourceLocalizationService(ContainerExecutor exec, DeletionService deletionContext, Context nmContext, NodeManagerMetrics nmMetrics)
protected SharedCacheUploadService createSharedCacheUploaderService()
protected NMTimelinePublisher createNMTimelinePublisher(Context ctxt)
protected AbstractContainersLauncher createContainersLauncher(Context ctxt, ContainerExecutor exec)
protected org.apache.hadoop.yarn.event.EventHandler<ApplicationEvent> createApplicationEventDispatcher()
protected void serviceStart() throws Exception
serviceStart
in class org.apache.hadoop.service.CompositeService
Exception
public void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.CompositeService
Exception
public void cleanUpApplicationsOnNMShutDown()
public void cleanupContainersOnNMResync()
protected org.apache.hadoop.security.UserGroupInformation getRemoteUgi() throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnException
@InterfaceAudience.Private protected org.apache.hadoop.yarn.security.NMTokenIdentifier selectNMTokenIdentifier(org.apache.hadoop.security.UserGroupInformation remoteUgi)
protected void authorizeUser(org.apache.hadoop.security.UserGroupInformation remoteUgi, org.apache.hadoop.yarn.security.NMTokenIdentifier nmTokenIdentifier) throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnException
@InterfaceAudience.Private protected void authorizeStartAndResourceIncreaseRequest(org.apache.hadoop.yarn.security.NMTokenIdentifier nmTokenIdentifier, org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier, boolean startRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
containerTokenIdentifier
- of the container whose resource is to be started or increasedorg.apache.hadoop.yarn.exceptions.YarnException
public org.apache.hadoop.yarn.api.protocolrecords.StartContainersResponse startContainers(org.apache.hadoop.yarn.api.protocolrecords.StartContainersRequest requests) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
startContainers
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
protected void startContainerInternal(org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier, org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest request, String remoteUser) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
org.apache.hadoop.yarn.exceptions.YarnException
IOException
protected org.apache.hadoop.yarn.security.ContainerTokenIdentifier verifyAndGetContainerTokenIdentifier(org.apache.hadoop.yarn.api.records.Token token, org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier) throws org.apache.hadoop.yarn.exceptions.YarnException, org.apache.hadoop.security.token.SecretManager.InvalidToken
org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.security.token.SecretManager.InvalidToken
@Deprecated public org.apache.hadoop.yarn.api.protocolrecords.IncreaseContainersResourceResponse increaseContainersResource(org.apache.hadoop.yarn.api.protocolrecords.IncreaseContainersResourceRequest requests) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
increaseContainersResource
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
public org.apache.hadoop.yarn.api.protocolrecords.ContainerUpdateResponse updateContainer(org.apache.hadoop.yarn.api.protocolrecords.ContainerUpdateRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
updateContainer
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
@InterfaceAudience.Private protected void updateNMTokenIdentifier(org.apache.hadoop.yarn.security.NMTokenIdentifier nmTokenIdentifier) throws org.apache.hadoop.security.token.SecretManager.InvalidToken
org.apache.hadoop.security.token.SecretManager.InvalidToken
public org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse stopContainers(org.apache.hadoop.yarn.api.protocolrecords.StopContainersRequest requests) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
stopContainers
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
protected void stopContainerInternal(org.apache.hadoop.yarn.api.records.ContainerId containerID, String remoteUser) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
org.apache.hadoop.yarn.exceptions.YarnException
IOException
public org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusesResponse getContainerStatuses(org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusesRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
getContainerStatuses
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
protected org.apache.hadoop.yarn.api.records.ContainerStatus getContainerStatusInternal(org.apache.hadoop.yarn.api.records.ContainerId containerID, org.apache.hadoop.yarn.security.NMTokenIdentifier nmTokenIdentifier, String remoteUser) throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnException
@InterfaceAudience.Private protected void authorizeGetAndStopContainerRequest(org.apache.hadoop.yarn.api.records.ContainerId containerId, Container container, boolean stopRequest, org.apache.hadoop.yarn.security.NMTokenIdentifier identifier, String remoteUser) throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnException
public void handle(ContainerManagerEvent event)
handle
in interface org.apache.hadoop.yarn.event.EventHandler<ContainerManagerEvent>
public void stateChanged(org.apache.hadoop.service.Service service)
stateChanged
in interface org.apache.hadoop.service.ServiceStateChangeListener
public Context getContext()
public Map<String,ByteBuffer> getAuxServiceMetaData()
@InterfaceAudience.Private public AMRMProxyService getAMRMProxyService()
@InterfaceAudience.Private protected void setAMRMProxyService(AMRMProxyService amrmProxyService)
protected boolean isServiceStopped()
public org.apache.hadoop.yarn.server.api.records.OpportunisticContainersStatus getOpportunisticContainersStatus()
getOpportunisticContainersStatus
in interface ContainerManager
public void updateQueuingLimit(org.apache.hadoop.yarn.server.api.records.ContainerQueuingLimit queuingLimit)
updateQueuingLimit
in interface ContainerManager
public org.apache.hadoop.yarn.api.protocolrecords.SignalContainerResponse signalToContainer(org.apache.hadoop.yarn.api.protocolrecords.SignalContainerRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
signalToContainer
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
public org.apache.hadoop.yarn.api.protocolrecords.ResourceLocalizationResponse localize(org.apache.hadoop.yarn.api.protocolrecords.ResourceLocalizationRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
localize
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
public org.apache.hadoop.yarn.api.protocolrecords.ReInitializeContainerResponse reInitializeContainer(org.apache.hadoop.yarn.api.protocolrecords.ReInitializeContainerRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
reInitializeContainer
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
public org.apache.hadoop.yarn.api.protocolrecords.RestartContainerResponse restartContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
restartContainer
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
public void reInitializeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.ContainerLaunchContext reInitLaunchContext, boolean autoCommit) throws org.apache.hadoop.yarn.exceptions.YarnException
containerId
- Container Id.autoCommit
- Auto Commit flag.reInitLaunchContext
- Target Launch Context.org.apache.hadoop.yarn.exceptions.YarnException
- YARN Exception.public org.apache.hadoop.yarn.api.protocolrecords.RollbackResponse rollbackLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws org.apache.hadoop.yarn.exceptions.YarnException
rollbackLastReInitialization
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
containerId
- Container ID.org.apache.hadoop.yarn.exceptions.YarnException
- YARN Exception.public org.apache.hadoop.yarn.api.protocolrecords.CommitResponse commitLastReInitialization(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws org.apache.hadoop.yarn.exceptions.YarnException
commitLastReInitialization
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
containerId
- Container ID.org.apache.hadoop.yarn.exceptions.YarnException
- YARN Exception.public ContainerScheduler getContainerScheduler()
getContainerScheduler
in interface ContainerManager
public void handleCredentialUpdate()
handleCredentialUpdate
in interface ContainerManager
public org.apache.hadoop.yarn.api.protocolrecords.GetLocalizationStatusesResponse getLocalizationStatuses(org.apache.hadoop.yarn.api.protocolrecords.GetLocalizationStatusesRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
getLocalizationStatuses
in interface org.apache.hadoop.yarn.api.ContainerManagementProtocol
org.apache.hadoop.yarn.exceptions.YarnException
IOException
public ResourceLocalizationService getResourceLocalizationService()
getResourceLocalizationService
in interface ContainerManager
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.