Class UpdateContainerRequest

java.lang.Object
org.apache.hadoop.yarn.api.records.UpdateContainerRequest

@Public @Unstable public abstract class UpdateContainerRequest extends Object
UpdateContainerRequest represents the request made by an application to the ResourceManager to update an attribute of a Container such as its Resource allocation or (@code ExecutionType}

It includes:

  • version for the container.
  • ContainerId for the container.
  • Resource capability of the container after the update request is completed.
  • ExecutionType of the container after the update request is completed.
Update rules:
  • Currently only ONE aspect of the container can be updated per request (user can either update Capability OR ExecutionType in one request.. not both).
  • There must be only 1 update request per container in an allocate call.
  • If a new update request is sent for a container (in a subsequent allocate call) before the first one is satisfied by the Scheduler, it will overwrite the previous request.
See Also:
  • Constructor Details

    • UpdateContainerRequest

      public UpdateContainerRequest()
  • Method Details

    • newInstance

      @Public @Unstable public static UpdateContainerRequest newInstance(int version, ContainerId containerId, ContainerUpdateType updateType, Resource targetCapability, ExecutionType targetExecutionType)
    • getContainerVersion

      @Public @Unstable public abstract int getContainerVersion()
      Get the ContainerId of the container.
      Returns:
      ContainerId of the container
    • setContainerVersion

      @Public @Unstable public abstract void setContainerVersion(int containerVersion)
      Set the current version of the container.
      Parameters:
      containerVersion - of the container
    • getContainerUpdateType

      @Public @Unstable public abstract ContainerUpdateType getContainerUpdateType()
      Get the ContainerUpdateType of the container.
      Returns:
      ContainerUpdateType of the container.
    • setContainerUpdateType

      @Public @Unstable public abstract void setContainerUpdateType(ContainerUpdateType updateType)
      Set the ContainerUpdateType of the container.
      Parameters:
      updateType - of the Container
    • getContainerId

      @Public @Unstable public abstract ContainerId getContainerId()
      Get the ContainerId of the container.
      Returns:
      ContainerId of the container
    • setContainerId

      @Public @Unstable public abstract void setContainerId(ContainerId containerId)
      Set the ContainerId of the container.
      Parameters:
      containerId - ContainerId of the container
    • getExecutionType

      @Public @Unstable public abstract ExecutionType getExecutionType()
      Get the target ExecutionType of the container.
      Returns:
      ExecutionType of the container
    • setExecutionType

      @Public @Unstable public abstract void setExecutionType(ExecutionType executionType)
      Set the target ExecutionType of the container.
      Parameters:
      executionType - ExecutionType of the container
    • setCapability

      @Public @Unstable public abstract void setCapability(Resource capability)
      Set the Resource capability of the request.
      Parameters:
      capability - Resource capability of the request
    • getCapability

      @Public @Unstable public abstract Resource getCapability()
      Get the Resource capability of the request.
      Returns:
      Resource capability of the request
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object