Class ReservationAllocationState
java.lang.Object
org.apache.hadoop.yarn.api.records.ReservationAllocationState
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.ResourceAllocationRequestrepresents 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 byReservationDefinition ReservationIdof the reservation.ReservationDefinitionused to make the reservation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract longGet the acceptance time of the reservation.abstract ReservationDefinitionGet the reservation definition used to make the reservation.abstract ReservationIdGet the id of the reservation.abstract List<ResourceAllocationRequest>Get the Resource allocations of the reservation based on the current state of the plan.abstract StringgetUser()Get the user who made the reservation.static ReservationAllocationStatenewInstance(long acceptanceTime, String user, List<ResourceAllocationRequest> resourceAllocations, ReservationId reservationId, ReservationDefinition reservationDefinition) abstract voidsetAcceptanceTime(long acceptanceTime) Set the time that the reservation was accepted.abstract voidsetReservationDefinition(ReservationDefinition reservationDefinition) Set the definition of the reservation.abstract voidsetReservationId(ReservationId reservationId) Set the id corresponding to the reservationabstract voidsetResourceAllocationRequests(List<ResourceAllocationRequest> resourceAllocations) Set the list of resource allocations made for the reservation.abstract voidsetUser(String user) Set the user who made the reservation.
-
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 ofResourceAllocationRequestrepresenting the current state of the reservation resource allocations. This is subject to change in the event of re-planning.reservationId-ReservationIdof the reservation being listed.reservationDefinition-ReservationDefinitionused to make the reservation.- Returns:
ReservationAllocationStatethat 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
Get the user who made the reservation.- Returns:
- the name of the user who made the reservation.
-
setUser
Set the user who made the reservation.- Parameters:
user- The username of the user who made the reservation.
-
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 theReservationDefinition- 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 ofResourceAllocationRequestrepresenting the current state of the reservation resource allocations. This is subject to change in the event of re-planning.
-
getReservationId
Get the id of the reservation.- Returns:
- the reservation id corresponding to the reservation.
-
setReservationId
Set the id corresponding to the reservation. `- Parameters:
reservationId-ReservationIdof the reservation being listed.
-
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-ReservationDefinitionused to make the reservation.
-