@InterfaceAudience.LimitedPrivate(value="yarn")
@InterfaceStability.Unstable
public interface SharingPolicy
ReservationAllocations for allocations being added to a Plan.
Individual policies will be enforcing different invariants.| Modifier and Type | Method and Description |
|---|---|
RLESparseResourceAllocation |
availableResources(RLESparseResourceAllocation available,
Plan plan,
String user,
org.apache.hadoop.yarn.api.records.ReservationId oldId,
long start,
long end)
This method provide a (partial) instantaneous validation by applying
business rules (such as max number of parallel containers allowed for a
user).
|
long |
getValidWindow()
Returns the time range before and after the current reservation considered
by this policy.
|
void |
init(String planQueuePath,
ReservationSchedulerConfiguration 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. |
void init(String planQueuePath, ReservationSchedulerConfiguration conf)
planQueuePath - the name of the queue for this planconf - the system configurationvoid validate(Plan plan, ReservationAllocation newAllocation) throws PlanningException
ReservationAllocation is acceptable according to this
sharing policy.plan - the Plan we validate againstnewAllocation - the allocation proposed to be added to the
PlanPlanningException - if the policy is respected if we add this
ReservationAllocation to the PlanRLESparseResourceAllocation availableResources(RLESparseResourceAllocation available, Plan plan, String user, org.apache.hadoop.yarn.api.records.ReservationId oldId, long start, long end) throws PlanningException
available - the amount of resources that would be offered if not
constrained by the policyplan - reference the the current Planuser - the usernamestart - the start time for the range we are queryingend - the end time for the range we are queryingoldId - (optional) the id of a reservation being updatedRLESparseResourceAllocationPlanningException - throws if the request is not validlong getValidWindow()
Plan, i.e., reservations regarding times before (now - validWindow)
can be deleted.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.