Class StageAllocatorGreedyRLE
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.reservation.planning.StageAllocatorGreedyRLE
- All Implemented Interfaces:
StageAllocator
Computes the stage allocation according to the greedy allocation rule. The
greedy rule repeatedly allocates requested containers at the leftmost or
rightmost possible interval. This implementation leverages the
run-length-encoding of the time-series we operate on and proceed more quickly
than the baseline.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMap<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> computeStageAllocation(Plan plan, RLESparseResourceAllocation planLoads, RLESparseResourceAllocation planModifications, org.apache.hadoop.yarn.api.records.ReservationRequest rr, long stageEarliestStart, 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.
-
Constructor Details
-
StageAllocatorGreedyRLE
public StageAllocatorGreedyRLE(boolean allocateLeft)
-
-
Method Details
-
computeStageAllocation
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 stageEarliestStart, long stageDeadline, long period, String user, org.apache.hadoop.yarn.api.records.ReservationId oldId) throws PlanningException Description copied from interface:StageAllocatorComputes the allocation of a stage inside a defined time interval.- Specified by:
computeStageAllocationin interfaceStageAllocator- Parameters:
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 algorithmperiod- the periodicity with which this stage appearsuser- name of the useroldId- identifier of the old reservation- Returns:
- The computed allocation (or null if the stage could not be allocated)
- Throws:
PlanningException- if operation is unsuccessful
-