Class StageExecutionIntervalByDemand

java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.reservation.planning.StageExecutionIntervalByDemand
All Implemented Interfaces:
StageExecutionInterval

public class StageExecutionIntervalByDemand extends Object implements 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 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: StageExecutionInterval
      Computes the earliest allowed starting time for a given stage.
      Specified by:
      computeExecutionInterval in interface StageExecutionInterval
      Parameters:
      plan - the Plan to which the reservation must be fitted
      reservation - the job contract
      currentReservationStage - the stage
      allocateLeft - is the job allocated from left to right
      allocations - 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)