Class ResourceOption

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

@Public @Evolving public abstract class ResourceOption extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Negative value means no timeout.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    build()
     
    abstract int
    getOverCommitTimeout()
    Get timeout for tolerant of resource over-commitment Note: negative value means no timeout so that allocated containers will keep running until the end even under resource over-commitment cases.
    abstract Resource
    getResource()
    Get the resource of the ResourceOption.
    newInstance(Resource resource, int overCommitTimeout)
     
    protected abstract void
    setOverCommitTimeout(int overCommitTimeout)
    Set the overcommit timeout.
    protected abstract void
    setResource(Resource resource)
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • OVER_COMMIT_TIMEOUT_MILLIS_DEFAULT

      public static final int OVER_COMMIT_TIMEOUT_MILLIS_DEFAULT
      Negative value means no timeout.
      See Also:
  • Constructor Details

    • ResourceOption

      public ResourceOption()
  • Method Details

    • newInstance

      public static ResourceOption newInstance(Resource resource, int overCommitTimeout)
    • getResource

      @Private @Evolving public abstract Resource getResource()
      Get the resource of the ResourceOption.
      Returns:
      resource of the ResourceOption
    • setResource

      @Private @Evolving protected abstract void setResource(Resource resource)
    • getOverCommitTimeout

      @Private @Evolving public abstract int getOverCommitTimeout()
      Get timeout for tolerant of resource over-commitment Note: negative value means no timeout so that allocated containers will keep running until the end even under resource over-commitment cases.
      Returns:
      overCommitTimeout of the ResourceOption in milliseconds.
    • setOverCommitTimeout

      @Private @Evolving protected abstract void setOverCommitTimeout(int overCommitTimeout)
      Set the overcommit timeout.
      Parameters:
      overCommitTimeout - Timeout in ms. Negative means no timeout.
    • build

      @Private @Evolving protected abstract void build()
    • toString

      public String toString()
      Overrides:
      toString in class Object