org.apache.hadoop.yarn.server.resourcemanager.reservation
Class CapacityOverTimePolicy

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.reservation.CapacityOverTimePolicy
All Implemented Interfaces:
SharingPolicy

@InterfaceAudience.LimitedPrivate(value="yarn")
@InterfaceStability.Unstable
public class CapacityOverTimePolicy
extends Object
implements SharingPolicy

This policy enforces a time-extended notion of Capacity. In particular it guarantees that the allocation received in input when combined with all previous allocation for the user does not violate an instantaneous max limit on the resources received, and that for every window of time of length validWindow, the integral of the allocations for a user (sum of the currently submitted allocation and all prior allocations for the user) does not exceed validWindow * maxAvg. This allows flexibility, in the sense that an allocation can instantaneously use large portions of the available capacity, but prevents abuses by bounding the average use over time. By controlling maxInst, maxAvg, validWindow the administrator configuring this policy can obtain a behavior ranging from instantaneously enforced capacity (akin to existing queues), or fully flexible allocations (likely reserved to super-users, or trusted systems).


Constructor Summary
CapacityOverTimePolicy()
           
 
Method Summary
 long getValidWindow()
          Returns the time range before and after the current reservation considered by this policy.
 void init(String reservationQueuePath, org.apache.hadoop.conf.Configuration conf)
          Initialize this policy
 void validate(Plan plan, ReservationAllocation reservation)
          This method runs the policy validation logic, and return true/false on whether the ReservationAllocation is acceptable according to this sharing policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapacityOverTimePolicy

public CapacityOverTimePolicy()
Method Detail

init

public void init(String reservationQueuePath,
                 org.apache.hadoop.conf.Configuration conf)
Description copied from interface: SharingPolicy
Initialize this policy

Specified by:
init in interface SharingPolicy
Parameters:
reservationQueuePath - the name of the queue for this plan
conf - the system configuration

validate

public void validate(Plan plan,
                     ReservationAllocation reservation)
              throws PlanningException
Description copied from interface: SharingPolicy
This method runs the policy validation logic, and return true/false on whether the ReservationAllocation is acceptable according to this sharing policy.

Specified by:
validate in interface SharingPolicy
Parameters:
plan - the Plan we validate against
reservation - the allocation proposed to be added to the Plan
Throws:
PlanningException - if the policy is respected if we add this ReservationAllocation to the Plan

getValidWindow

public long getValidWindow()
Description copied from interface: SharingPolicy
Returns the time range before and after the current reservation considered by this policy. In particular, this informs the archival process for the Plan, i.e., reservations regarding times before (now - validWindow) can be deleted.

Specified by:
getValidWindow in interface SharingPolicy
Returns:
validWindow the window of validity considered by the policy.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.