Class ContainerImpl
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl
- All Implemented Interfaces:
org.apache.hadoop.yarn.event.EventHandler<ContainerEvent>,Container
-
Constructor Summary
ConstructorsConstructorDescriptionContainerImpl(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.event.Dispatcher dispatcher, org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext, org.apache.hadoop.security.Credentials creds, NodeManagerMetrics metrics, org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier, Context context) ContainerImpl(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.event.Dispatcher dispatcher, org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext, org.apache.hadoop.security.Credentials creds, NodeManagerMetrics metrics, org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier, Context context, long startTs) ContainerImpl(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.event.Dispatcher dispatcher, org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext, org.apache.hadoop.security.Credentials creds, NodeManagerMetrics metrics, org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier, Context context, NMStateStoreService.RecoveredContainerState rcs) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidcleanup()org.apache.hadoop.yarn.api.records.ContainerStatusvoidorg.apache.hadoop.yarn.api.records.ContainerIdlongThe timestamp when the container is allowed to be launched.<T> TgetContainerRuntimeData(Class<T> runtimeClass) longThe timestamp when the container start request is received.org.apache.hadoop.yarn.security.ContainerTokenIdentifierorg.apache.hadoop.security.Credentialsorg.apache.hadoop.yarn.api.records.ContainerStateorg.apache.hadoop.yarn.api.records.ContainerLaunchContextList<org.apache.hadoop.yarn.api.records.LocalizationStatus>Get the localization statuses.org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatusorg.apache.hadoop.yarn.api.records.Priorityorg.apache.hadoop.yarn.api.records.ResourceGet assigned resource mappings to the container.getUser()voidhandle(ContainerEvent event) booleanVerify container is in final states.booleanbooleanbooleanbooleanbooleanVector of localization counters to be passed from NM to application container via environment variable$LOCALIZATION_COUNTERS.voidsendKillEvent(int exitStatus, String description) voidvoidsendPauseEvent(String description) voidsetContainerRuntimeData(Object containerRuntimeData) voidsetContainerTokenIdentifier(org.apache.hadoop.yarn.security.ContainerTokenIdentifier token) voidsetCsiVolumesRootDir(String volumesRootDir) voidsetExposedPorts(String ports) voidsetIpAndHost(String[] ipAndHost) voidsetIsReInitializing(boolean isReInitializing) voidvoidsetWorkDir(String workDir) booleanshouldRetry(int errorCode) toString()
-
Constructor Details
-
ContainerImpl
public ContainerImpl(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.event.Dispatcher dispatcher, org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext, org.apache.hadoop.security.Credentials creds, NodeManagerMetrics metrics, org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier, Context context) -
ContainerImpl
public ContainerImpl(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.event.Dispatcher dispatcher, org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext, org.apache.hadoop.security.Credentials creds, NodeManagerMetrics metrics, org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier, Context context, long startTs) -
ContainerImpl
public ContainerImpl(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.event.Dispatcher dispatcher, org.apache.hadoop.yarn.api.records.ContainerLaunchContext launchContext, org.apache.hadoop.security.Credentials creds, NodeManagerMetrics metrics, org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier, Context context, NMStateStoreService.RecoveredContainerState rcs)
-
-
Method Details
-
getCurrentState
public org.apache.hadoop.yarn.api.records.ContainerState getCurrentState() -
getNMTimelinePublisher
-
getUser
-
getLocalizedResources
- Specified by:
getLocalizedResourcesin interfaceContainer
-
getCredentials
public org.apache.hadoop.security.Credentials getCredentials()- Specified by:
getCredentialsin interfaceContainer
-
getContainerState
- Specified by:
getContainerStatein interfaceContainer
-
getLaunchContext
public org.apache.hadoop.yarn.api.records.ContainerLaunchContext getLaunchContext()- Specified by:
getLaunchContextin interfaceContainer
-
cloneAndGetContainerStatus
public org.apache.hadoop.yarn.api.records.ContainerStatus cloneAndGetContainerStatus()- Specified by:
cloneAndGetContainerStatusin interfaceContainer
-
getNMContainerStatus
public org.apache.hadoop.yarn.server.api.protocolrecords.NMContainerStatus getNMContainerStatus()- Specified by:
getNMContainerStatusin interfaceContainer
-
getContainerId
public org.apache.hadoop.yarn.api.records.ContainerId getContainerId()- Specified by:
getContainerIdin interfaceContainer
-
getContainerStartTime
public long getContainerStartTime()Description copied from interface:ContainerThe timestamp when the container start request is received.- Specified by:
getContainerStartTimein interfaceContainer
-
getContainerLaunchTime
public long getContainerLaunchTime()Description copied from interface:ContainerThe timestamp when the container is allowed to be launched.- Specified by:
getContainerLaunchTimein interfaceContainer
-
getResource
public org.apache.hadoop.yarn.api.records.Resource getResource()- Specified by:
getResourcein interfaceContainer
-
getContainerTokenIdentifier
public org.apache.hadoop.yarn.security.ContainerTokenIdentifier getContainerTokenIdentifier()- Specified by:
getContainerTokenIdentifierin interfaceContainer
-
setContainerTokenIdentifier
public void setContainerTokenIdentifier(org.apache.hadoop.yarn.security.ContainerTokenIdentifier token) - Specified by:
setContainerTokenIdentifierin interfaceContainer
-
getWorkDir
- Specified by:
getWorkDirin interfaceContainer
-
setWorkDir
- Specified by:
setWorkDirin interfaceContainer
-
getCsiVolumesRootDir
- Specified by:
getCsiVolumesRootDirin interfaceContainer
-
setCsiVolumesRootDir
- Specified by:
setCsiVolumesRootDirin interfaceContainer
-
setIpAndHost
- Specified by:
setIpAndHostin interfaceContainer
-
getLogDir
-
setLogDir
-
getResourceSet
- Specified by:
getResourceSetin interfaceContainer
-
sendLaunchEvent
public void sendLaunchEvent()- Specified by:
sendLaunchEventin interfaceContainer
-
sendKillEvent
- Specified by:
sendKillEventin interfaceContainer
-
sendPauseEvent
- Specified by:
sendPauseEventin interfaceContainer
-
cleanup
public void cleanup() -
isRetryContextSet
public boolean isRetryContextSet()- Specified by:
isRetryContextSetin interfaceContainer
-
shouldRetry
public boolean shouldRetry(int errorCode) - Specified by:
shouldRetryin interfaceContainer
-
handle
- Specified by:
handlein interfaceorg.apache.hadoop.yarn.event.EventHandler<ContainerEvent>
-
toString
-
getPriority
public org.apache.hadoop.yarn.api.records.Priority getPriority()- Specified by:
getPriorityin interfaceContainer
-
isRunning
public boolean isRunning() -
setIsReInitializing
public void setIsReInitializing(boolean isReInitializing) - Specified by:
setIsReInitializingin interfaceContainer
-
isReInitializing
public boolean isReInitializing()- Specified by:
isReInitializingin interfaceContainer
-
isMarkedForKilling
public boolean isMarkedForKilling()- Specified by:
isMarkedForKillingin interfaceContainer
-
canRollback
public boolean canRollback()- Specified by:
canRollbackin interfaceContainer
-
commitUpgrade
public void commitUpgrade()- Specified by:
commitUpgradein interfaceContainer
-
isRecovering
public boolean isRecovering()- Specified by:
isRecoveringin interfaceContainer
-
getResourceMappings
Get assigned resource mappings to the container.- Specified by:
getResourceMappingsin interfaceContainer- Returns:
- Resource Mappings of the container
-
isContainerInFinalStates
public boolean isContainerInFinalStates()Description copied from interface:ContainerVerify container is in final states.- Specified by:
isContainerInFinalStatesin interfaceContainer- Returns:
- true/false based on container's state
-
setExposedPorts
- Specified by:
setExposedPortsin interfaceContainer
-
getLocalizationStatuses
Description copied from interface:ContainerGet the localization statuses.- Specified by:
getLocalizationStatusesin interfaceContainer- Returns:
- localization statuses.
-
setContainerRuntimeData
- Specified by:
setContainerRuntimeDatain interfaceContainer
-
getContainerRuntimeData
- Specified by:
getContainerRuntimeDatain interfaceContainer- Throws:
ContainerExecutionException
-
localizationCountersAsString
Description copied from interface:ContainerVector of localization counters to be passed from NM to application container via environment variable$LOCALIZATION_COUNTERS. SeeApplicationConstants.Environment.LOCALIZATION_COUNTERS- Specified by:
localizationCountersAsStringin interfaceContainer- Returns:
- coma-separated counter values
-