org.apache.hadoop.yarn.server.resourcemanager.reservation
Interface SharingPolicy

All Known Implementing Classes:
CapacityOverTimePolicy, NoOverCommitPolicy

@InterfaceAudience.LimitedPrivate(value="yarn")
@InterfaceStability.Unstable
public interface SharingPolicy

This is the interface for policy that validate new ReservationAllocations for allocations being added to a Plan. Individual policies will be enforcing different invariants.


Method Summary
 long getValidWindow()
          Returns the time range before and after the current reservation considered by this policy.
 void init(String planQueuePath, org.apache.hadoop.conf.Configuration conf)
          Initialize this policy
 void validate(Plan plan, ReservationAllocation newAllocation)
          This method runs the policy validation logic, and return true/false on whether the ReservationAllocation is acceptable according to this sharing policy.
 

Method Detail

init

void init(String planQueuePath,
          org.apache.hadoop.conf.Configuration conf)
Initialize this policy

Parameters:
planQueuePath - the name of the queue for this plan
conf - the system configuration

validate

void validate(Plan plan,
              ReservationAllocation newAllocation)
              throws PlanningException
This method runs the policy validation logic, and return true/false on whether the ReservationAllocation is acceptable according to this sharing policy.

Parameters:
plan - the Plan we validate against
newAllocation - 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

long getValidWindow()
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.

Returns:
validWindow the window of validity considered by the policy.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.