public class RLESparseResourceAllocation extends Object
| Constructor and Description |
|---|
RLESparseResourceAllocation(org.apache.hadoop.yarn.util.resource.ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource minAlloc) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCompositeInterval(ReservationInterval reservationInterval,
List<org.apache.hadoop.yarn.api.records.ReservationRequest> ReservationRequests,
org.apache.hadoop.yarn.api.records.Resource clusterResource)
Add multiple resources for the specified interval
|
boolean |
addInterval(ReservationInterval reservationInterval,
org.apache.hadoop.yarn.api.records.ReservationRequest capacity)
Add a resource for the specified interval
|
org.apache.hadoop.yarn.api.records.Resource |
getCapacityAtTime(long tick)
Returns the capacity, i.e.
|
long |
getEarliestStartTime()
Get the timestamp of the earliest resource allocation
|
long |
getLatestEndTime()
Get the timestamp of the latest resource allocation
|
boolean |
isEmpty()
Returns true if there are no non-zero entries
|
boolean |
removeInterval(ReservationInterval reservationInterval,
org.apache.hadoop.yarn.api.records.ReservationRequest capacity)
Removes a resource for the specified interval
|
String |
toMemJSONString()
Returns the JSON string representation of the current resources allocated
over time
|
String |
toString() |
public RLESparseResourceAllocation(org.apache.hadoop.yarn.util.resource.ResourceCalculator resourceCalculator,
org.apache.hadoop.yarn.api.records.Resource minAlloc)
public boolean addInterval(ReservationInterval reservationInterval, org.apache.hadoop.yarn.api.records.ReservationRequest capacity)
reservationInterval - the interval for which the resource is to be
addedcapacity - the resource to be addedpublic boolean addCompositeInterval(ReservationInterval reservationInterval, List<org.apache.hadoop.yarn.api.records.ReservationRequest> ReservationRequests, org.apache.hadoop.yarn.api.records.Resource clusterResource)
reservationInterval - the interval for which the resource is to be
addedReservationRequests - the resources to be addedclusterResource - the total resources in the clusterpublic boolean removeInterval(ReservationInterval reservationInterval, org.apache.hadoop.yarn.api.records.ReservationRequest capacity)
reservationInterval - the interval for which the resource is to be
removedcapacity - the resource to be removedpublic org.apache.hadoop.yarn.api.records.Resource getCapacityAtTime(long tick)
tick - the time (UTC in ms) at which the capacity is requestedpublic long getEarliestStartTime()
public long getLatestEndTime()
public boolean isEmpty()
public String toMemJSONString()
Copyright © 2016 Apache Software Foundation. All Rights Reserved.