Class InMemoryReservationAllocation
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.reservation.InMemoryReservationAllocation
- All Implemented Interfaces:
Comparable<ReservationAllocation>,ReservationAllocation
An in memory implementation of a reservation allocation using the
RLESparseResourceAllocation-
Constructor Summary
ConstructorsConstructorDescriptionInMemoryReservationAllocation(org.apache.hadoop.yarn.api.records.ReservationId reservationID, org.apache.hadoop.yarn.api.records.ReservationDefinition contract, String user, String planName, long startTime, long endTime, Map<ReservationInterval, org.apache.hadoop.yarn.api.records.Resource> allocations, org.apache.hadoop.yarn.util.resource.ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource minAlloc) InMemoryReservationAllocation(org.apache.hadoop.yarn.api.records.ReservationId reservationID, org.apache.hadoop.yarn.api.records.ReservationDefinition contract, String user, String planName, long startTime, long endTime, Map<ReservationInterval, org.apache.hadoop.yarn.api.records.Resource> allocations, org.apache.hadoop.yarn.util.resource.ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource minAlloc, boolean hasGang) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ReservationAllocation other) booleanReturns whether the reservation has gang semantics or notbooleanlongReturns 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 reservationinthashCode()voidsetAcceptanceTimestamp(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.toString()
-
Constructor Details
-
InMemoryReservationAllocation
public InMemoryReservationAllocation(org.apache.hadoop.yarn.api.records.ReservationId reservationID, org.apache.hadoop.yarn.api.records.ReservationDefinition contract, String user, String planName, long startTime, long endTime, Map<ReservationInterval, org.apache.hadoop.yarn.api.records.Resource> allocations, org.apache.hadoop.yarn.util.resource.ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource minAlloc) -
InMemoryReservationAllocation
public InMemoryReservationAllocation(org.apache.hadoop.yarn.api.records.ReservationId reservationID, org.apache.hadoop.yarn.api.records.ReservationDefinition contract, String user, String planName, long startTime, long endTime, Map<ReservationInterval, org.apache.hadoop.yarn.api.records.Resource> allocations, org.apache.hadoop.yarn.util.resource.ResourceCalculator calculator, org.apache.hadoop.yarn.api.records.Resource minAlloc, boolean hasGang)
-
-
Method Details
-
getReservationId
public org.apache.hadoop.yarn.api.records.ReservationId getReservationId()Description copied from interface:ReservationAllocationReturns the unique identifierReservationIdthat represents the reservation- Specified by:
getReservationIdin interfaceReservationAllocation- Returns:
- reservationId the unique identifier
ReservationIdthat represents the reservation
-
getReservationDefinition
public org.apache.hadoop.yarn.api.records.ReservationDefinition getReservationDefinition()Description copied from interface:ReservationAllocationReturns the originalReservationDefinitionsubmitted by the client- Specified by:
getReservationDefinitionin interfaceReservationAllocation- Returns:
- the
ReservationDefinitionsubmitted by the client
-
getStartTime
public long getStartTime()Description copied from interface:ReservationAllocationReturns the time at which the reservation is activated.- Specified by:
getStartTimein interfaceReservationAllocation- Returns:
- the time at which the reservation is activated
-
getEndTime
public long getEndTime()Description copied from interface:ReservationAllocationReturns the time at which the reservation terminates.- Specified by:
getEndTimein interfaceReservationAllocation- Returns:
- the time at which the reservation terminates
-
getAllocationRequests
Description copied from interface:ReservationAllocationReturns the map of resources requested against the time interval for which they were.- Specified by:
getAllocationRequestsin interfaceReservationAllocation- Returns:
- the allocationRequests the map of resources requested against the time interval for which they were
-
getPlanName
Description copied from interface:ReservationAllocationReturn a string identifying the plan to which the reservation belongs- Specified by:
getPlanNamein interfaceReservationAllocation- Returns:
- the plan to which the reservation belongs
-
getUser
Description copied from interface:ReservationAllocationReturns the user who requested the reservation- Specified by:
getUserin interfaceReservationAllocation- Returns:
- the user who requested the reservation
-
containsGangs
public boolean containsGangs()Description copied from interface:ReservationAllocationReturns whether the reservation has gang semantics or not- Specified by:
containsGangsin interfaceReservationAllocation- Returns:
- true if there is a gang request, false otherwise
-
setAcceptanceTimestamp
public void setAcceptanceTimestamp(long acceptedAt) Description copied from interface:ReservationAllocationSets the time at which the reservation was accepted by the system- Specified by:
setAcceptanceTimestampin interfaceReservationAllocation- Parameters:
acceptedAt- the time at which the reservation was accepted by the system
-
getAcceptanceTime
public long getAcceptanceTime()Description copied from interface:ReservationAllocationReturns the time at which the reservation was accepted by the system- Specified by:
getAcceptanceTimein interfaceReservationAllocation- Returns:
- the time at which the reservation was accepted by the system
-
getResourcesAtTime
public org.apache.hadoop.yarn.api.records.Resource getResourcesAtTime(long tick) Description copied from interface:ReservationAllocationReturns the capacity represented by cumulative resources reserved by the reservation at the specified point of time- Specified by:
getResourcesAtTimein interfaceReservationAllocation- Parameters:
tick- the time (UTC in ms) for which the reserved resources are requested- Returns:
- the resources reserved at the specified time
-
getResourcesOverTime
Description copied from interface:ReservationAllocationReturn a RLE representation of used resources.- Specified by:
getResourcesOverTimein interfaceReservationAllocation- Returns:
- a RLE encoding of resources allocated over time.
-
getResourcesOverTime
Description copied from interface:ReservationAllocationReturn a RLE representation of used resources.- Specified by:
getResourcesOverTimein interfaceReservationAllocation- Parameters:
start- start of the time interval.end- end of the time interval.- Returns:
- a RLE encoding of resources allocated over time.
-
getPeriodicity
public long getPeriodicity()Description copied from interface:ReservationAllocationGet 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.- Specified by:
getPeriodicityin interfaceReservationAllocation- Returns:
- periodicity of this reservation
-
setPeriodicity
public void setPeriodicity(long period) Description copied from interface:ReservationAllocationSet 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.- Specified by:
setPeriodicityin interfaceReservationAllocation- Parameters:
period- periodicity of this reservation
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<ReservationAllocation>
-
hashCode
public int hashCode() -
equals
-