Interface ReservationAllocation

All Superinterfaces:
Comparable<ReservationAllocation>
All Known Implementing Classes:
InMemoryReservationAllocation

public interface ReservationAllocation extends Comparable<ReservationAllocation>
A ReservationAllocation represents a concrete allocation of resources over time that satisfy a certain ReservationDefinition. This is used internally by a Plan to store information about how each of the accepted ReservationDefinition have been allocated.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether the reservation has gang semantics or not
    long
    Returns the time at which the reservation was accepted by the system
    Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource>
    Returns the map of resources requested against the time interval for which they were.
    long
    Returns the time at which the reservation terminates.
    long
    Get the periodicity of this reservation representing the time period of the periodic job.
    Return a string identifying the plan to which the reservation belongs
    org.apache.hadoop.yarn.api.records.ReservationDefinition
    Returns the original ReservationDefinition submitted by the client
    org.apache.hadoop.yarn.api.records.ReservationId
    Returns the unique identifier ReservationId that represents the reservation
    org.apache.hadoop.yarn.api.records.Resource
    getResourcesAtTime(long tick)
    Returns the capacity represented by cumulative resources reserved by the reservation at the specified point of time
    Return a RLE representation of used resources.
    getResourcesOverTime(long start, long end)
    Return a RLE representation of used resources.
    long
    Returns the time at which the reservation is activated.
    Returns the user who requested the reservation
    void
    setAcceptanceTimestamp(long acceptedAt)
    Sets the time at which the reservation was accepted by the system
    void
    setPeriodicity(long period)
    Set the periodicity of this reservation representing the time period of the periodic job.

    Methods inherited from interface java.lang.Comparable

    compareTo
  • Method Details

    • getReservationId

      org.apache.hadoop.yarn.api.records.ReservationId getReservationId()
      Returns the unique identifier ReservationId that represents the reservation
      Returns:
      reservationId the unique identifier ReservationId that represents the reservation
    • getReservationDefinition

      org.apache.hadoop.yarn.api.records.ReservationDefinition getReservationDefinition()
      Returns the original ReservationDefinition submitted by the client
      Returns:
      the ReservationDefinition submitted by the client
    • getStartTime

      long getStartTime()
      Returns the time at which the reservation is activated.
      Returns:
      the time at which the reservation is activated
    • getEndTime

      long getEndTime()
      Returns the time at which the reservation terminates.
      Returns:
      the time at which the reservation terminates
    • getAllocationRequests

      Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> getAllocationRequests()
      Returns the map of resources requested against the time interval for which they were.
      Returns:
      the allocationRequests the map of resources requested against the time interval for which they were
    • getPlanName

      String getPlanName()
      Return a string identifying the plan to which the reservation belongs
      Returns:
      the plan to which the reservation belongs
    • getUser

      String getUser()
      Returns the user who requested the reservation
      Returns:
      the user who requested the reservation
    • containsGangs

      boolean containsGangs()
      Returns whether the reservation has gang semantics or not
      Returns:
      true if there is a gang request, false otherwise
    • setAcceptanceTimestamp

      void setAcceptanceTimestamp(long acceptedAt)
      Sets the time at which the reservation was accepted by the system
      Parameters:
      acceptedAt - the time at which the reservation was accepted by the system
    • getAcceptanceTime

      long getAcceptanceTime()
      Returns the time at which the reservation was accepted by the system
      Returns:
      the time at which the reservation was accepted by the system
    • getResourcesAtTime

      org.apache.hadoop.yarn.api.records.Resource getResourcesAtTime(long tick)
      Returns the capacity represented by cumulative resources reserved by the reservation at the specified point of time
      Parameters:
      tick - the time (UTC in ms) for which the reserved resources are requested
      Returns:
      the resources reserved at the specified time
    • getResourcesOverTime

      RLESparseResourceAllocation getResourcesOverTime()
      Return a RLE representation of used resources.
      Returns:
      a RLE encoding of resources allocated over time.
    • getResourcesOverTime

      RLESparseResourceAllocation getResourcesOverTime(long start, long end)
      Return a RLE representation of used resources.
      Parameters:
      start - start of the time interval.
      end - end of the time interval.
      Returns:
      a RLE encoding of resources allocated over time.
    • getPeriodicity

      long getPeriodicity()
      Get the periodicity of this reservation representing the time period of the periodic job. Period is represented in milliseconds for periodic jobs. Period is 0 for non-periodic jobs.
      Returns:
      periodicity of this reservation
    • setPeriodicity

      @VisibleForTesting void setPeriodicity(long period)
      Set the periodicity of this reservation representing the time period of the periodic job. Period is represented in milliseconds for periodic jobs. Period is 0 for non-periodic jobs.
      Parameters:
      period - periodicity of this reservation