Class ReservationRequest

java.lang.Object
org.apache.hadoop.yarn.api.records.ReservationRequest
All Implemented Interfaces:
Comparable<ReservationRequest>

@Public @Unstable public abstract class ReservationRequest extends Object implements Comparable<ReservationRequest>
ReservationRequest represents the request made by an application to the ResourceManager to reserve Resources.

It includes:

  • Resource required for each request.
  • Number of containers, of above specifications, which are required by the application.
  • Concurrency that indicates the gang size of the request.
  • Constructor Details

    • ReservationRequest

      public ReservationRequest()
  • Method Details

    • newInstance

      @Public @Unstable public static ReservationRequest newInstance(Resource capability, int numContainers)
    • newInstance

      @Public @Unstable public static ReservationRequest newInstance(Resource capability, int numContainers, int concurrency, long duration)
    • getCapability

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

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

      @Public @Unstable public abstract int getNumContainers()
      Get the number of containers required with the given specifications.
      Returns:
      number of containers required with the given specifications
    • setNumContainers

      @Public @Unstable public abstract void setNumContainers(int numContainers)
      Set the number of containers required with the given specifications
      Parameters:
      numContainers - number of containers required with the given specifications
    • getConcurrency

      @Public @Unstable public abstract int getConcurrency()
      Get the number of containers that need to be scheduled concurrently. The default value of 1 would fall back to the current non concurrency constraints on the scheduling behavior.
      Returns:
      the number of containers to be concurrently scheduled
    • setConcurrency

      @Public @Unstable public abstract void setConcurrency(int numContainers)
      Set the number of containers that need to be scheduled concurrently. The default value of 1 would fall back to the current non concurrency constraints on the scheduling behavior.
      Parameters:
      numContainers - the number of containers to be concurrently scheduled
    • getDuration

      @Public @Unstable public abstract long getDuration()
      Get the duration in milliseconds for which the resource is required. A default value of -1, indicates an unspecified lease duration, and fallback to current behavior.
      Returns:
      the duration in milliseconds for which the resource is required
    • setDuration

      @Public @Unstable public abstract void setDuration(long duration)
      Set the duration in milliseconds for which the resource is required.
      Parameters:
      duration - the duration in milliseconds for which the resource is required
    • hashCode

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

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

      public int compareTo(ReservationRequest other)
      Specified by:
      compareTo in interface Comparable<ReservationRequest>