public class StageAllocatorLowCostAligned extends Object implements StageAllocator
StageAllocatorLowCostAligned.DurationInterval
with lowest overall cost. The algorithm only
considers intervals of the form: [stageDeadline - (n+1)*duration,
stageDeadline - n*duration) for an integer n. This guarantees that the
allocations are aligned (as opposed to overlapping duration intervals).
The smoothnessFactor parameter controls the number of containers that are
simultaneously allocated in each iteration of the algorithm.Modifier and Type | Class and Description |
---|---|
protected static class |
StageAllocatorLowCostAligned.DurationInterval
An inner class that represents an interval, typically of length duration.
|
Constructor and Description |
---|
StageAllocatorLowCostAligned() |
StageAllocatorLowCostAligned(int smoothnessFactor) |
Modifier and Type | Method and Description |
---|---|
protected double |
calcCostOfInterval(long startTime,
long endTime,
Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads,
RLESparseResourceAllocation planModifications,
org.apache.hadoop.yarn.api.records.Resource capacity,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc,
long step) |
protected double |
calcCostOfLoad(org.apache.hadoop.yarn.api.records.Resource load,
org.apache.hadoop.yarn.api.records.Resource capacity,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc) |
protected double |
calcCostOfTimeSlot(long t,
Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads,
RLESparseResourceAllocation planModifications,
org.apache.hadoop.yarn.api.records.Resource capacity,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc) |
Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> |
computeStageAllocation(Plan plan,
Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads,
RLESparseResourceAllocation planModifications,
org.apache.hadoop.yarn.api.records.ReservationRequest rr,
long stageEarliestStart,
long stageDeadline,
String user,
org.apache.hadoop.yarn.api.records.ReservationId oldId)
Computes the allocation of a stage inside a defined time interval.
|
protected StageAllocatorLowCostAligned.DurationInterval |
getDurationInterval(long startTime,
long endTime,
Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads,
RLESparseResourceAllocation planModifications,
org.apache.hadoop.yarn.api.records.Resource capacity,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc,
long step) |
protected org.apache.hadoop.yarn.api.records.Resource |
getLoadAtTime(long t,
Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads,
RLESparseResourceAllocation planModifications) |
protected static long |
stepRoundDown(long t,
long step) |
protected static long |
stepRoundUp(long t,
long step) |
public StageAllocatorLowCostAligned()
public StageAllocatorLowCostAligned(int smoothnessFactor)
public Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> computeStageAllocation(Plan plan, Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads, RLESparseResourceAllocation planModifications, org.apache.hadoop.yarn.api.records.ReservationRequest rr, long stageEarliestStart, long stageDeadline, String user, org.apache.hadoop.yarn.api.records.ReservationId oldId)
StageAllocator
computeStageAllocation
in interface StageAllocator
plan
- the Plan to which the reservation must be fittedplanLoads
- a 'dirty' read of the plan loads at each timeplanModifications
- the allocations performed by the planning
algorithm which are not yet reflected by planrr
- the stagestageEarliestStart
- the arrival time (earliest starting time) set for
the stage by the two phase planning algorithmstageDeadline
- the deadline of the stage set by the two phase
planning algorithmprotected StageAllocatorLowCostAligned.DurationInterval getDurationInterval(long startTime, long endTime, Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads, RLESparseResourceAllocation planModifications, org.apache.hadoop.yarn.api.records.Resource capacity, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc, long step)
protected double calcCostOfInterval(long startTime, long endTime, Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads, RLESparseResourceAllocation planModifications, org.apache.hadoop.yarn.api.records.Resource capacity, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc, long step)
protected double calcCostOfTimeSlot(long t, Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads, RLESparseResourceAllocation planModifications, org.apache.hadoop.yarn.api.records.Resource capacity, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc)
protected org.apache.hadoop.yarn.api.records.Resource getLoadAtTime(long t, Map<Long,org.apache.hadoop.yarn.api.records.Resource> planLoads, RLESparseResourceAllocation planModifications)
protected double calcCostOfLoad(org.apache.hadoop.yarn.api.records.Resource load, org.apache.hadoop.yarn.api.records.Resource capacity, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc)
protected static long stepRoundDown(long t, long step)
protected static long stepRoundUp(long t, long step)
Copyright © 2017 Apache Software Foundation. All Rights Reserved.