ContainerContext (Apache Hadoop YARN API 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.server.api, class: ContainerContext

Package org.apache.hadoop.yarn.server.api

# Class ContainerContext

java.lang.Object
org.apache.hadoop.yarn.server.api.ContainerContext

Direct Known Subclasses:
  `ContainerInitializationContext`, `ContainerTerminationContext`

@Public @Evolving public class ContainerContext extends Object
Base context class for `AuxiliaryService` initializing and stopping a container.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContainerContext(String user, ContainerId containerId, Resource resource)`
  `ContainerContext(String user, ContainerId containerId, Resource resource, ContainerType containerType)`
  `ContainerContext(String user, ContainerId containerId, Resource resource, ContainerType containerType, ExecutionType executionType)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ContainerId`
  `getContainerId()`
  Get `ContainerId` of the container being initialized or stopped.
  `ContainerType`
  `getContainerType()`
  Get `ContainerType` the type of the container being initialized or stopped.
  `ExecutionType`
  `getExecutionType()`
  Get `ExecutionType` the execution type of the container being initialized or stopped.
  `Resource`
  `getResource()`
  Get `Resource` the resource capability allocated to the container being initialized or stopped.
  `String`
  `getUser()`
  Get user of the container being initialized or stopped.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ContainerContext

    @Private @Unstable public ContainerContext(String user, ContainerId containerId, Resource resource)

  - ### ContainerContext

    @Private @Unstable public ContainerContext(String user, ContainerId containerId, Resource resource, ContainerType containerType)

  - ### ContainerContext

    @Private @Unstable public ContainerContext(String user, ContainerId containerId, Resource resource, ContainerType containerType, ExecutionType executionType)

- ## Method Details

  - ### getUser

    public String getUser()
    Get user of the container being initialized or stopped.
    Returns:
      the user

  - ### getContainerId

    public ContainerId getContainerId()
    Get `ContainerId` of the container being initialized or stopped.
    Returns:
      the container ID

  - ### getResource

    public Resource getResource()
    Get `Resource` the resource capability allocated to the container being initialized or stopped.
    Returns:
      the resource capability.

  - ### getContainerType

    public ContainerType getContainerType()
    Get `ContainerType` the type of the container being initialized or stopped.
    Returns:
      the type of the container

  - ### getExecutionType

    public ExecutionType getExecutionType()
    Get `ExecutionType` the execution type of the container being initialized or stopped.
    Returns:
      the execution type of the container