Class StageExecutionIntervalByDemand
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.reservation.planning.StageExecutionIntervalByDemand
- All Implemented Interfaces:
StageExecutionInterval
An implementation of
StageExecutionInterval, which sets the execution
interval of the stage. For ANY and ALL jobs, the interval is
[jobArrival,jobDeadline]. For ORDER jobs, the the maximal possible time
interval is divided as follows: First, each stage is guaranteed at least its
requested duration. Then, the stage receives a fraction of the remaining
time. The fraction is calculated as the ratio between the weight (total
requested resources) of the stage and the total weight of all remaining
stages.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecalcWeight(org.apache.hadoop.yarn.api.records.ReservationRequest stage) computeExecutionInterval(Plan plan, org.apache.hadoop.yarn.api.records.ReservationDefinition reservation, org.apache.hadoop.yarn.api.records.ReservationRequest currentReservationStage, boolean allocateLeft, RLESparseResourceAllocation allocations) Computes the earliest allowed starting time for a given stage.protected longgetRoundedDuration(org.apache.hadoop.yarn.api.records.ReservationRequest stage, Long s) protected static longstepRoundDown(long t, long s) protected static longstepRoundUp(long t, long s)
-
Constructor Details
-
StageExecutionIntervalByDemand
public StageExecutionIntervalByDemand()
-
-
Method Details
-
computeExecutionInterval
public ReservationInterval computeExecutionInterval(Plan plan, org.apache.hadoop.yarn.api.records.ReservationDefinition reservation, org.apache.hadoop.yarn.api.records.ReservationRequest currentReservationStage, boolean allocateLeft, RLESparseResourceAllocation allocations) Description copied from interface:StageExecutionIntervalComputes the earliest allowed starting time for a given stage.- Specified by:
computeExecutionIntervalin interfaceStageExecutionInterval- Parameters:
plan- the Plan to which the reservation must be fittedreservation- the job contractcurrentReservationStage- the stageallocateLeft- is the job allocated from left to rightallocations- Existing resource assignments for the job- Returns:
- the time interval in which the stage can get resources.
-
calcWeight
protected double calcWeight(org.apache.hadoop.yarn.api.records.ReservationRequest stage) -
getRoundedDuration
protected long getRoundedDuration(org.apache.hadoop.yarn.api.records.ReservationRequest stage, Long s) -
stepRoundDown
protected static long stepRoundDown(long t, long s) -
stepRoundUp
protected static long stepRoundUp(long t, long s)
-