public class PeriodicRLESparseResourceAllocation extends RLESparseResourceAllocation
RLESparseResourceAllocation
.
Default period is 1 day (86400000ms).RLESparseResourceAllocation.RLEOperator
cumulativeCapacity, readLock
Constructor and Description |
---|
PeriodicRLESparseResourceAllocation(org.apache.hadoop.yarn.util.resource.ResourceCalculator resourceCalculator)
Constructor.
|
PeriodicRLESparseResourceAllocation(org.apache.hadoop.yarn.util.resource.ResourceCalculator resourceCalculator,
Long timePeriod)
Constructor.
|
PeriodicRLESparseResourceAllocation(RLESparseResourceAllocation rleVector,
Long timePeriod)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addInterval(ReservationInterval interval,
org.apache.hadoop.yarn.api.records.Resource resource)
Add resource for the specified interval.
|
org.apache.hadoop.yarn.api.records.Resource |
getCapacityAtTime(long tick)
Get capacity at time based on periodic repetition.
|
org.apache.hadoop.yarn.api.records.Resource |
getMaximumPeriodicCapacity(long tick,
long period)
Get maximum capacity at periodic offsets from the specified time.
|
RLESparseResourceAllocation |
getRangeOverlapping(long start,
long end)
Get a
RLESparseResourceAllocation view of the Resource
allocations between the specified start and end times. |
long |
getTimePeriod()
Get time period of PeriodicRLESparseResourceAllocation.
|
boolean |
removeInterval(ReservationInterval interval,
org.apache.hadoop.yarn.api.records.Resource resource)
Removes a resource for the specified interval.
|
String |
toString() |
getCumulative, getEarliestStartTime, getLatestNonNullTime, getMinimumCapacityInInterval, getResourceCalculator, isEmpty, merge, shift, toIntervalMap
public PeriodicRLESparseResourceAllocation(org.apache.hadoop.yarn.util.resource.ResourceCalculator resourceCalculator, Long timePeriod)
resourceCalculator
- ResourceCalculator
the resource
calculator to use.timePeriod
- Time period in milliseconds.public PeriodicRLESparseResourceAllocation(org.apache.hadoop.yarn.util.resource.ResourceCalculator resourceCalculator)
resourceCalculator
- ResourceCalculator
the resource
calculator to use..public PeriodicRLESparseResourceAllocation(RLESparseResourceAllocation rleVector, Long timePeriod)
rleVector
- RLESparseResourceAllocation
with the run-length
encoded data.timePeriod
- Time period in milliseconds.public org.apache.hadoop.yarn.api.records.Resource getCapacityAtTime(long tick)
getCapacityAtTime
in class RLESparseResourceAllocation
tick
- UTC time for which the allocated Resource
is queried.Resource
allocated at specified timepublic boolean addInterval(ReservationInterval interval, org.apache.hadoop.yarn.api.records.Resource resource)
InMemoryPlan
while placing reservations between 0 and timePeriod.
The interval may include 0, but the end time must be strictly less than
timePeriod.addInterval
in class RLESparseResourceAllocation
interval
- ReservationInterval
to which the specified resource
is to be added.resource
- Resource
to be added to the interval specified.public boolean removeInterval(ReservationInterval interval, org.apache.hadoop.yarn.api.records.Resource resource)
removeInterval
in class RLESparseResourceAllocation
interval
- the ReservationInterval
for which the resource is
to be removed.resource
- the Resource
to be removed.public org.apache.hadoop.yarn.api.records.Resource getMaximumPeriodicCapacity(long tick, long period)
getMaximumPeriodicCapacity
in class RLESparseResourceAllocation
tick
- UTC time base from which offsets are specified for finding the
maximum capacity.period
- periodic offset at which capacities are evaluated.Resource
across the specified time instants.public long getTimePeriod()
public String toString()
toString
in class RLESparseResourceAllocation
public RLESparseResourceAllocation getRangeOverlapping(long start, long end)
RLESparseResourceAllocation
RLESparseResourceAllocation
view of the Resource
allocations between the specified start and end times.getRangeOverlapping
in class RLESparseResourceAllocation
start
- the time from which the Resource
allocations are
requiredend
- the time upto which the Resource
allocations are
requiredCopyright © 2008–2020 Apache Software Foundation. All rights reserved.