Class ReservationAllocationState

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

@Public @Stable public abstract class ReservationAllocationState extends Object
ReservationAllocationState represents the reservation that is made by a user.

It includes:

  • Duration of the reservation.
  • Acceptance time of the duration.
  • List of ResourceAllocationRequest, which includes the time interval, and capability of the allocation. ResourceAllocationRequest represents an allocation made for a reservation for the current state of the queue. 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
  • ReservationId of the reservation.
  • ReservationDefinition used to make the reservation.
See Also:
  • Constructor Details

    • ReservationAllocationState

      public ReservationAllocationState()
  • Method Details

    • newInstance

      @Public @Stable public static ReservationAllocationState newInstance(long acceptanceTime, String user, List<ResourceAllocationRequest> resourceAllocations, ReservationId reservationId, ReservationDefinition reservationDefinition)
      Parameters:
      acceptanceTime - The acceptance time of the reservation.
      user - The username of the user who made the reservation.
      resourceAllocations - List of ResourceAllocationRequest representing the current state of the reservation resource allocations. This is subject to change in the event of re-planning.
      reservationId - ReservationId of the reservation being listed.
      reservationDefinition - ReservationDefinition used to make the reservation.
      Returns:
      ReservationAllocationState that represents the state of the reservation.
    • getAcceptanceTime

      @Public @Unstable public abstract long getAcceptanceTime()
      Get the acceptance time of the reservation.
      Returns:
      the time that the reservation was accepted.
    • setAcceptanceTime

      @Private @Unstable public abstract void setAcceptanceTime(long acceptanceTime)
      Set the time that the reservation was accepted.
      Parameters:
      acceptanceTime - The acceptance time of the reservation.
    • getUser

      @Public @Unstable public abstract String getUser()
      Get the user who made the reservation.
      Returns:
      the name of the user who made the reservation.
    • setUser

      @Private @Unstable public abstract void setUser(String user)
      Set the user who made the reservation.
      Parameters:
      user - The username of the user who made the reservation.
    • getResourceAllocationRequests

      @Public @Unstable public abstract List<ResourceAllocationRequest> getResourceAllocationRequests()
      Get the Resource allocations of the reservation based on the current state of the plan. This is subject to change in the event of re-planning. The allocations will be constraint to the user contract as described by the ReservationDefinition
      Returns:
      a list of resource allocations for the reservation.
    • setResourceAllocationRequests

      @Private @Unstable public abstract void setResourceAllocationRequests(List<ResourceAllocationRequest> resourceAllocations)
      Set the list of resource allocations made for the reservation.
      Parameters:
      resourceAllocations - List of ResourceAllocationRequest representing the current state of the reservation resource allocations. This is subject to change in the event of re-planning.
    • getReservationId

      @Public @Unstable public abstract ReservationId getReservationId()
      Get the id of the reservation.
      Returns:
      the reservation id corresponding to the reservation.
    • setReservationId

      @Private @Unstable public abstract void setReservationId(ReservationId reservationId)
      Set the id corresponding to the reservation. `
      Parameters:
      reservationId - ReservationId of the reservation being listed.
    • getReservationDefinition

      @Public @Unstable public abstract ReservationDefinition getReservationDefinition()
      Get the reservation definition used to make the reservation.
      Returns:
      the reservation definition used to make the reservation.
    • setReservationDefinition

      @Private @Unstable public abstract void setReservationDefinition(ReservationDefinition reservationDefinition)
      Set the definition of the reservation.
      Parameters:
      reservationDefinition - ReservationDefinition used to make the reservation.