Interface ReservationAllocation
- All Superinterfaces:
Comparable<ReservationAllocation>
- All Known Implementing Classes:
InMemoryReservationAllocation
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 TypeMethodDescriptionbooleanReturns whether the reservation has gang semantics or notlongReturns the time at which the reservation was accepted by the systemMap<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> Returns the map of resources requested against the time interval for which they were.longReturns the time at which the reservation terminates.longGet the periodicity of this reservation representing the time period of the periodic job.Return a string identifying the plan to which the reservation belongsorg.apache.hadoop.yarn.api.records.ReservationDefinitionReturns the originalReservationDefinitionsubmitted by the clientorg.apache.hadoop.yarn.api.records.ReservationIdReturns the unique identifierReservationIdthat represents the reservationorg.apache.hadoop.yarn.api.records.ResourcegetResourcesAtTime(long tick) Returns the capacity represented by cumulative resources reserved by the reservation at the specified point of timeReturn a RLE representation of used resources.getResourcesOverTime(long start, long end) Return a RLE representation of used resources.longReturns the time at which the reservation is activated.getUser()Returns the user who requested the reservationvoidsetAcceptanceTimestamp(long acceptedAt) Sets the time at which the reservation was accepted by the systemvoidsetPeriodicity(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 identifierReservationIdthat represents the reservation- Returns:
- reservationId the unique identifier
ReservationIdthat represents the reservation
-
getReservationDefinition
org.apache.hadoop.yarn.api.records.ReservationDefinition getReservationDefinition()Returns the originalReservationDefinitionsubmitted by the client- Returns:
- the
ReservationDefinitionsubmitted 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
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
-