@InterfaceAudience.LimitedPrivate(value="yarn") @InterfaceStability.Unstable public class CapacityOverTimePolicy extends Object implements SharingPolicy
| Constructor and Description |
|---|
CapacityOverTimePolicy() |
| 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 reservationQueuePath,
ReservationSchedulerConfiguration 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. |
public void init(String reservationQueuePath, ReservationSchedulerConfiguration conf)
SharingPolicyinit in interface SharingPolicyreservationQueuePath - the name of the queue for this planconf - the system configurationpublic void validate(Plan plan, ReservationAllocation reservation) throws PlanningException
SharingPolicyReservationAllocation is acceptable according to this
sharing policy.validate in interface SharingPolicyplan - the Plan we validate againstreservation - the allocation proposed to be added to the
PlanPlanningException - if the policy is respected if we add this
ReservationAllocation to the Planpublic RLESparseResourceAllocation availableResources(RLESparseResourceAllocation available, Plan plan, String user, org.apache.hadoop.yarn.api.records.ReservationId oldId, long start, long end) throws PlanningException
SharingPolicyavailableResources in interface SharingPolicyavailable - the amount of resources that would be offered if not
constrained by the policyplan - reference the the current Planuser - the usernameoldId - (optional) the id of a reservation being updatedstart - the start time for the range we are queryingend - the end time for the range we are queryingPlanningException - throws if the request is not validpublic long getValidWindow()
SharingPolicyPlan, i.e., reservations regarding times before (now - validWindow)
can be deleted.getValidWindow in interface SharingPolicyCopyright © 2017 Apache Software Foundation. All Rights Reserved.