Class RMContainerImpl
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerImpl
- All Implemented Interfaces:
Comparable<RMContainer>,org.apache.hadoop.yarn.event.EventHandler<RMContainerEvent>,RMContainer
-
Constructor Summary
ConstructorsConstructorDescriptionRMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext) RMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext, boolean isExternallyAllocated) RMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext, long creationTime, String nodeLabelExpression) RMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext, long creationTime, String nodeLabelExpression, boolean isExternallyAllocated) RMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext, String nodeLabelExpression) -
Method Summary
Modifier and TypeMethodDescriptionintbooleanorg.apache.hadoop.yarn.api.records.ContainerReportbooleanorg.apache.hadoop.yarn.api.records.NodeIdorg.apache.hadoop.yarn.api.records.Resourceorg.apache.hadoop.yarn.api.records.Priorityorg.apache.hadoop.yarn.api.records.Resourceorg.apache.hadoop.yarn.server.scheduler.SchedulerRequestKeyReturnSchedulingRequest.getAllocationTags()specified by AM.org.apache.hadoop.yarn.api.records.ApplicationAttemptIdorg.apache.hadoop.yarn.api.records.Containerintorg.apache.hadoop.yarn.api.records.ContainerIdorg.apache.hadoop.yarn.api.records.ContainerStatelongorg.apache.hadoop.yarn.api.records.ExecutionTypelongorg.apache.hadoop.yarn.api.records.Resourceorg.apache.hadoop.yarn.api.records.NodeIdorg.apache.hadoop.yarn.api.records.NodeIdorg.apache.hadoop.yarn.api.records.Resourceorg.apache.hadoop.yarn.server.scheduler.SchedulerRequestKeygetState()voidhandle(RMContainerEvent event) inthashCode()booleanbooleanIf the container was allocated by a container other than the Resource Manager (e.g., the distributed scheduler in the NMLocalScheduler).protected voidonInvalidStateTransition(RMContainerEventType rmContainerEventType, RMContainerState state) catch the InvalidStateTransition.voidsetAllocationTags(Set<String> tags) voidsetAMContainer(boolean isAMContainer) voidsetContainer(org.apache.hadoop.yarn.api.records.Container container) voidsetContainerId(org.apache.hadoop.yarn.api.records.ContainerId containerId) voidsetContainerRequest(ContainerRequest request) voidvoidsetQueueName(String queueName) toString()
-
Constructor Details
-
RMContainerImpl
public RMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext) -
RMContainerImpl
public RMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext, boolean isExternallyAllocated) -
RMContainerImpl
public RMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext, String nodeLabelExpression) -
RMContainerImpl
public RMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext, long creationTime, String nodeLabelExpression) -
RMContainerImpl
public RMContainerImpl(org.apache.hadoop.yarn.api.records.Container container, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String user, RMContext rmContext, long creationTime, String nodeLabelExpression, boolean isExternallyAllocated)
-
-
Method Details
-
getContainerId
public org.apache.hadoop.yarn.api.records.ContainerId getContainerId()- Specified by:
getContainerIdin interfaceRMContainer
-
getApplicationAttemptId
public org.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId()- Specified by:
getApplicationAttemptIdin interfaceRMContainer
-
getContainer
public org.apache.hadoop.yarn.api.records.Container getContainer()- Specified by:
getContainerin interfaceRMContainer
-
setContainer
public void setContainer(org.apache.hadoop.yarn.api.records.Container container) -
getState
- Specified by:
getStatein interfaceRMContainer
-
getReservedResource
public org.apache.hadoop.yarn.api.records.Resource getReservedResource()- Specified by:
getReservedResourcein interfaceRMContainer
-
getReservedNode
public org.apache.hadoop.yarn.api.records.NodeId getReservedNode()- Specified by:
getReservedNodein interfaceRMContainer
-
getReservedSchedulerKey
public org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey getReservedSchedulerKey()- Specified by:
getReservedSchedulerKeyin interfaceRMContainer
-
getAllocatedResource
public org.apache.hadoop.yarn.api.records.Resource getAllocatedResource()- Specified by:
getAllocatedResourcein interfaceRMContainer
-
getLastConfirmedResource
public org.apache.hadoop.yarn.api.records.Resource getLastConfirmedResource()- Specified by:
getLastConfirmedResourcein interfaceRMContainer
-
getAllocatedNode
public org.apache.hadoop.yarn.api.records.NodeId getAllocatedNode()- Specified by:
getAllocatedNodein interfaceRMContainer
-
getAllocatedSchedulerKey
public org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey getAllocatedSchedulerKey()- Specified by:
getAllocatedSchedulerKeyin interfaceRMContainer
-
getAllocatedPriority
public org.apache.hadoop.yarn.api.records.Priority getAllocatedPriority()- Specified by:
getAllocatedPriorityin interfaceRMContainer
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTimein interfaceRMContainer
-
getFinishTime
public long getFinishTime()- Specified by:
getFinishTimein interfaceRMContainer
-
getDiagnosticsInfo
- Specified by:
getDiagnosticsInfoin interfaceRMContainer
-
getLogURL
- Specified by:
getLogURLin interfaceRMContainer
-
getContainerExitStatus
public int getContainerExitStatus()- Specified by:
getContainerExitStatusin interfaceRMContainer
-
getContainerState
public org.apache.hadoop.yarn.api.records.ContainerState getContainerState()- Specified by:
getContainerStatein interfaceRMContainer
-
getContainerRequest
- Specified by:
getContainerRequestin interfaceRMContainer
-
setContainerRequest
-
toString
-
isAMContainer
public boolean isAMContainer()- Specified by:
isAMContainerin interfaceRMContainer
-
setAMContainer
public void setAMContainer(boolean isAMContainer) -
handle
- Specified by:
handlein interfaceorg.apache.hadoop.yarn.event.EventHandler<RMContainerEvent>
-
completed
public boolean completed()- Specified by:
completedin interfaceRMContainer
-
getNodeId
public org.apache.hadoop.yarn.api.records.NodeId getNodeId()- Specified by:
getNodeIdin interfaceRMContainer
-
getAllocationTags
Description copied from interface:RMContainerReturnSchedulingRequest.getAllocationTags()specified by AM.- Specified by:
getAllocationTagsin interfaceRMContainer- Returns:
- allocation tags, could be null/empty
-
setAllocationTags
-
createContainerReport
public org.apache.hadoop.yarn.api.records.ContainerReport createContainerReport()- Specified by:
createContainerReportin interfaceRMContainer
-
getNodeHttpAddress
- Specified by:
getNodeHttpAddressin interfaceRMContainer
-
getExposedPorts
- Specified by:
getExposedPortsin interfaceRMContainer
-
setExposedPorts
- Specified by:
setExposedPortsin interfaceRMContainer
-
getNodeLabelExpression
- Specified by:
getNodeLabelExpressionin interfaceRMContainer
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<RMContainer>
-
setQueueName
-
getQueueName
- Specified by:
getQueueNamein interfaceRMContainer
-
getExecutionType
public org.apache.hadoop.yarn.api.records.ExecutionType getExecutionType()- Specified by:
getExecutionTypein interfaceRMContainer
-
isRemotelyAllocated
public boolean isRemotelyAllocated()Description copied from interface:RMContainerIf the container was allocated by a container other than the Resource Manager (e.g., the distributed scheduler in the NMLocalScheduler).- Specified by:
isRemotelyAllocatedin interfaceRMContainer- Returns:
- If the container was allocated remotely.
-
getAllocatedOrReservedResource
public org.apache.hadoop.yarn.api.records.Resource getAllocatedOrReservedResource()- Specified by:
getAllocatedOrReservedResourcein interfaceRMContainer
-
setContainerId
public void setContainerId(org.apache.hadoop.yarn.api.records.ContainerId containerId) - Specified by:
setContainerIdin interfaceRMContainer
-
onInvalidStateTransition
@VisibleForTesting protected void onInvalidStateTransition(RMContainerEventType rmContainerEventType, RMContainerState state) catch the InvalidStateTransition.- Parameters:
state- RMContainerState.rmContainerEventType- RMContainerEventType.
-