public class InMemoryReservationAllocation extends Object implements ReservationAllocation
RLESparseResourceAllocation
Constructor and Description |
---|
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(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) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ReservationAllocation other) |
boolean |
containsGangs()
Returns whether the reservation has gang semantics or not
|
boolean |
equals(Object obj) |
long |
getAcceptanceTime()
Returns the time at which the reservation was accepted by the system
|
Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> |
getAllocationRequests()
Returns the map of resources requested against the time interval for which
they were.
|
long |
getEndTime()
Returns the time at which the reservation terminates.
|
String |
getPlanName()
Return a string identifying the plan to which the reservation belongs
|
org.apache.hadoop.yarn.api.records.ReservationDefinition |
getReservationDefinition()
Returns the original
ReservationDefinition submitted by the client |
org.apache.hadoop.yarn.api.records.ReservationId |
getReservationId()
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
|
RLESparseResourceAllocation |
getResourcesOverTime()
Return a RLE representation of used resources.
|
long |
getStartTime()
Returns the time at which the reservation is activated.
|
String |
getUser()
Returns the user who requested the reservation
|
int |
hashCode() |
void |
setAcceptanceTimestamp(long acceptedAt)
Sets the time at which the reservation was accepted by the system
|
String |
toString() |
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)
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)
public org.apache.hadoop.yarn.api.records.ReservationId getReservationId()
ReservationAllocation
ReservationId
that represents the
reservationgetReservationId
in interface ReservationAllocation
ReservationId
that
represents the reservationpublic org.apache.hadoop.yarn.api.records.ReservationDefinition getReservationDefinition()
ReservationAllocation
ReservationDefinition
submitted by the clientgetReservationDefinition
in interface ReservationAllocation
ReservationDefinition
submitted by the clientpublic long getStartTime()
ReservationAllocation
getStartTime
in interface ReservationAllocation
public long getEndTime()
ReservationAllocation
getEndTime
in interface ReservationAllocation
public Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> getAllocationRequests()
ReservationAllocation
getAllocationRequests
in interface ReservationAllocation
public String getPlanName()
ReservationAllocation
getPlanName
in interface ReservationAllocation
public String getUser()
ReservationAllocation
getUser
in interface ReservationAllocation
public boolean containsGangs()
ReservationAllocation
containsGangs
in interface ReservationAllocation
public void setAcceptanceTimestamp(long acceptedAt)
ReservationAllocation
setAcceptanceTimestamp
in interface ReservationAllocation
acceptedAt
- the time at which the reservation was accepted by the
systempublic long getAcceptanceTime()
ReservationAllocation
getAcceptanceTime
in interface ReservationAllocation
public org.apache.hadoop.yarn.api.records.Resource getResourcesAtTime(long tick)
ReservationAllocation
getResourcesAtTime
in interface ReservationAllocation
tick
- the time (UTC in ms) for which the reserved resources are
requestedpublic RLESparseResourceAllocation getResourcesOverTime()
ReservationAllocation
getResourcesOverTime
in interface ReservationAllocation
public int compareTo(ReservationAllocation other)
compareTo
in interface Comparable<ReservationAllocation>
Copyright © 2017 Apache Software Foundation. All Rights Reserved.