Class ContainerStatus
java.lang.Object
org.apache.hadoop.yarn.api.records.ContainerStatus
ContainerStatus represents the current status of a
Container.
It provides details such as:
ContainerIdof the container.ExecutionTypeof the container.ContainerStateof the container.- Exit status of a completed container.
- Diagnostic message for a failed container.
Resourceallocated to the container.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet theResourceallocated to the container.abstract ContainerIdGet theContainerIdof the container.getContainerSubState()Get Extra state information of the container (SCHEDULED, LOCALIZING etc.).abstract StringGet diagnostic messages for failed containers.Get theExecutionTypeof the container.abstract intGet the exit status for the container.Get exposed ports of the container.getHost()Get the hostname where the container runs.getIPs()Get all the IP addresses with which the container run.abstract ContainerStategetState()Get theContainerStateof the container.static ContainerStatusnewInstance(ContainerId containerId, ContainerState containerState, String diagnostics, int exitStatus) static ContainerStatusnewInstance(ContainerId containerId, ExecutionType executionType, ContainerState containerState, String diagnostics, int exitStatus) voidsetCapability(Resource capability) abstract voidsetContainerId(ContainerId containerId) voidsetContainerSubState(ContainerSubState subState) Add Extra state information of the container (SCHEDULED, LOCALIZING etc.).abstract voidsetDiagnostics(String diagnostics) voidsetExecutionType(ExecutionType executionType) abstract voidsetExitStatus(int exitStatus) voidsetExposedPorts(String ports) voidsetHost(String host) voidabstract voidsetState(ContainerState state)
-
Constructor Details
-
ContainerStatus
public ContainerStatus()
-
-
Method Details
-
newInstance
@Private @Unstable public static ContainerStatus newInstance(ContainerId containerId, ContainerState containerState, String diagnostics, int exitStatus) -
newInstance
@Private @Unstable public static ContainerStatus newInstance(ContainerId containerId, ExecutionType executionType, ContainerState containerState, String diagnostics, int exitStatus) -
getContainerId
Get theContainerIdof the container.- Returns:
ContainerIdof the container
-
setContainerId
-
getExecutionType
Get theExecutionTypeof the container.- Returns:
ExecutionTypeof the container
-
setExecutionType
-
getState
Get theContainerStateof the container.- Returns:
ContainerStateof the container
-
setState
-
getExitStatus
@Public @Unstable public abstract int getExitStatus()Get the exit status for the container.
Note: This is valid only for completed containers i.e. containers with state
ContainerState.COMPLETE. Otherwise, it returns an ContainerExitStatus.INVALID.Containers killed by the framework, either due to being released by the application or being 'lost' due to node failures etc. have a special exit code of ContainerExitStatus.ABORTED.
When threshold number of the nodemanager-local-directories or threshold number of the nodemanager-log-directories become bad, then container is not launched and is exited with ContainersExitStatus.DISKS_FAILED.
- Returns:
- exit status for the container
-
setExitStatus
@Private @Unstable public abstract void setExitStatus(int exitStatus) -
getDiagnostics
Get diagnostic messages for failed containers.- Returns:
- diagnostic messages for failed containers
-
setDiagnostics
-
getCapability
Get theResourceallocated to the container.- Returns:
Resourceallocated to the container
-
setCapability
-
getIPs
Get all the IP addresses with which the container run.- Returns:
- The IP address where the container runs.
-
setIPs
-
getHost
Get the hostname where the container runs.- Returns:
- The hostname where the container runs.
-
setHost
-
setContainerSubState
Add Extra state information of the container (SCHEDULED, LOCALIZING etc.).- Parameters:
subState- Extra State Information.
-
getContainerSubState
Get Extra state information of the container (SCHEDULED, LOCALIZING etc.).- Returns:
- Extra State information.
-
getExposedPorts
Get exposed ports of the container.- Returns:
- List of exposed ports
-
setExposedPorts
-