Class ResourceAllocationRequest

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

@Public @Stable public abstract class ResourceAllocationRequest extends Object
ResourceAllocationRequest represents an allocation made for a reservation for the current state of the plan. This can be changed for reasons such as re-planning, but will always be subject to the constraints of the user contract as described by ReservationDefinition Resource

It includes:

  • StartTime of the allocation.
  • EndTime of the allocation.
  • Resource reserved for the allocation.
See Also:
  • Constructor Details

    • ResourceAllocationRequest

      public ResourceAllocationRequest()
  • Method Details

    • newInstance

      @Public @Stable public static ResourceAllocationRequest newInstance(long startTime, long endTime, Resource capability)
      Parameters:
      startTime - The start time that the capability is reserved for.
      endTime - The end time that the capability is reserved for.
      capability - Resource representing the capability of the resource allocation.
      Returns:
      {ResourceAllocationRequest} which represents the capability of the resource allocation for a time interval.
    • getStartTime

      @Public @Unstable public abstract long getStartTime()
      Get the start time that the resource is allocated.
      Returns:
      the start time that the resource is allocated.
    • setStartTime

      @Private @Unstable public abstract void setStartTime(long startTime)
      Set the start time that the resource is allocated.
      Parameters:
      startTime - The start time that the capability is reserved for.
    • getEndTime

      @Public @Unstable public abstract long getEndTime()
      Get the end time that the resource is allocated.
      Returns:
      the end time that the resource is allocated.
    • setEndTime

      @Private @Unstable public abstract void setEndTime(long endTime)
      Set the end time that the resource is allocated.
      Parameters:
      endTime - The end time that the capability is reserved for.
    • getCapability

      @Public @Unstable public abstract Resource getCapability()
      Get the allocated resource.
      Returns:
      the allocated resource.
    • setCapability

      @Private @Unstable public abstract void setCapability(Resource resource)
      Set the allocated resource.
      Parameters:
      resource - Resource representing the capability of the resource allocation.