@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)
SharingPolicy
init
in interface SharingPolicy
init
in class NoOverCommitPolicy
reservationQueuePath
- the name of the queue for this planconf
- the system configurationpublic void validate(Plan plan, ReservationAllocation reservation) throws PlanningException
validate
in interface SharingPolicy
validate
in class NoOverCommitPolicy
plan
- 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
SharingPolicy
availableResources
in interface SharingPolicy
availableResources
in class NoOverCommitPolicy
available
- 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 queryingRLESparseResourceAllocation
PlanningException
- throws if the request is not validpublic long getValidWindow()
SharingPolicy
Plan
, i.e., reservations regarding times before (now - validWindow)
can be deleted.getValidWindow
in interface SharingPolicy
getValidWindow
in class NoOverCommitPolicy
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.