public class StageAllocatorLowCostAligned extends Object implements StageAllocator
StageAllocatorLowCostAligned.DurationInterval
with lowest overall cost. The algorithm only
considers non-overlapping intervals of length 'duration'. This guarantees
that the allocations are aligned. If 'allocateLeft == true', the intervals
considered by the algorithm are aligned to stageArrival; otherwise, they are
aligned to stageDeadline. 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(boolean allocateLeft) |
StageAllocatorLowCostAligned(int smoothnessFactor,
boolean allocateLeft) |
Modifier and Type | Method and Description |
---|---|
protected double |
calcCostOfInterval(long startTime,
long endTime,
RLESparseResourceAllocation planLoads,
RLESparseResourceAllocation planModifications,
org.apache.hadoop.yarn.api.records.Resource capacity,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc,
long step) |
protected static 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,
RLESparseResourceAllocation 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,
RLESparseResourceAllocation planLoads,
RLESparseResourceAllocation planModifications,
org.apache.hadoop.yarn.api.records.ReservationRequest rr,
long stageArrival,
long stageDeadline,
long period,
String user,
org.apache.hadoop.yarn.api.records.ReservationId oldId)
Computes the allocation of a stage inside a defined time interval.
|
protected static StageAllocatorLowCostAligned.DurationInterval |
getDurationInterval(long startTime,
long endTime,
RLESparseResourceAllocation planLoads,
RLESparseResourceAllocation planModifications,
org.apache.hadoop.yarn.api.records.Resource capacity,
RLESparseResourceAllocation netRLERes,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc,
long step,
org.apache.hadoop.yarn.api.records.Resource requestedResources) |
protected static int |
getDurationIntervalGangsCanFit(long startTime,
long endTime,
RLESparseResourceAllocation planModifications,
org.apache.hadoop.yarn.api.records.Resource capacity,
RLESparseResourceAllocation netRLERes,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc,
org.apache.hadoop.yarn.api.records.Resource requestedResources) |
protected static double |
getDurationIntervalTotalCost(long startTime,
long endTime,
RLESparseResourceAllocation 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,
RLESparseResourceAllocation planLoads,
RLESparseResourceAllocation planModifications) |
protected static long |
stepRoundDown(long t,
long step) |
protected static long |
stepRoundUp(long t,
long step) |
public StageAllocatorLowCostAligned(boolean allocateLeft)
public StageAllocatorLowCostAligned(int smoothnessFactor, boolean allocateLeft)
public Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> computeStageAllocation(Plan plan, RLESparseResourceAllocation planLoads, RLESparseResourceAllocation planModifications, org.apache.hadoop.yarn.api.records.ReservationRequest rr, long stageArrival, long stageDeadline, long period, String user, org.apache.hadoop.yarn.api.records.ReservationId oldId) throws PlanningException
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 stagestageArrival
- 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 algorithmperiod
- the periodicity with which this stage appearsuser
- name of the useroldId
- identifier of the old reservationPlanningException
- if operation is unsuccessfulprotected static StageAllocatorLowCostAligned.DurationInterval getDurationInterval(long startTime, long endTime, RLESparseResourceAllocation planLoads, RLESparseResourceAllocation planModifications, org.apache.hadoop.yarn.api.records.Resource capacity, RLESparseResourceAllocation netRLERes, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc, long step, org.apache.hadoop.yarn.api.records.Resource requestedResources) throws PlanningException
PlanningException
protected static double getDurationIntervalTotalCost(long startTime, long endTime, RLESparseResourceAllocation planLoads, RLESparseResourceAllocation planModifications, org.apache.hadoop.yarn.api.records.Resource capacity, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc, long step) throws PlanningException
PlanningException
protected static int getDurationIntervalGangsCanFit(long startTime, long endTime, RLESparseResourceAllocation planModifications, org.apache.hadoop.yarn.api.records.Resource capacity, RLESparseResourceAllocation netRLERes, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc, org.apache.hadoop.yarn.api.records.Resource requestedResources) throws PlanningException
PlanningException
protected double calcCostOfInterval(long startTime, long endTime, RLESparseResourceAllocation 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, RLESparseResourceAllocation 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, RLESparseResourceAllocation planLoads, RLESparseResourceAllocation planModifications)
protected static 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 © 2008–2021 Apache Software Foundation. All rights reserved.