@InterfaceAudience.LimitedPrivate(value="yarn") @InterfaceStability.Unstable public class CapacityOverTimePolicy extends NoOverCommitPolicy
| 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)
The validation algorithm walks over the RLE encoded allocation and
checks that for all transition points (when the start or end of the
checking window encounters a value in the RLE).
|
public void init(String reservationQueuePath, ReservationSchedulerConfiguration conf)
SharingPolicyinit in interface SharingPolicyinit in class NoOverCommitPolicyreservationQueuePath - the name of the queue for this planconf - the system configurationpublic void validate(Plan plan, ReservationAllocation reservation) throws PlanningException
validate in interface SharingPolicyvalidate in class NoOverCommitPolicyplan - the plan to validate againstreservation - the reservation allocation to test.PlanningException - if the validation fails.public 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 SharingPolicyavailableResources in class NoOverCommitPolicyavailable - 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 queryingRLESparseResourceAllocationPlanningException - throws if the request is not validpublic long getValidWindow()
SharingPolicyPlan, i.e., reservations regarding times before (now - validWindow)
can be deleted.getValidWindow in interface SharingPolicygetValidWindow in class NoOverCommitPolicyCopyright © 2022 Apache Software Foundation. All rights reserved.