Class NoOverCommitPolicy
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.reservation.NoOverCommitPolicy
- All Implemented Interfaces:
SharingPolicy
- Direct Known Subclasses:
CapacityOverTimePolicy
@LimitedPrivate("yarn")
@Unstable
public class NoOverCommitPolicy
extends Object
implements SharingPolicy
This policy enforce a simple physical cluster capacity constraints, by
validating that the allocation proposed fits in the current plan. This
validation is compatible with "updates" and in verifying the capacity
constraints it conceptually remove the prior version of the reservation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionavailableResources(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).longReturns the time range before and after the current reservation considered by this policy.voidinit(String planQueuePath, ReservationSchedulerConfiguration conf) Initialize this policy.voidvalidate(Plan plan, ReservationAllocation reservation) This method runs the policy validation logic, and return true/false on whether theReservationAllocationis acceptable according to this sharing policy.
-
Constructor Details
-
NoOverCommitPolicy
public NoOverCommitPolicy()
-
-
Method Details
-
validate
Description copied from interface:SharingPolicyThis method runs the policy validation logic, and return true/false on whether theReservationAllocationis acceptable according to this sharing policy.- Specified by:
validatein interfaceSharingPolicy- Parameters:
plan- thePlanwe validate againstreservation- the allocation proposed to be added to thePlan- Throws:
PlanningException- if the policy is respected if we add thisReservationAllocationto thePlan
-
getValidWindow
public long getValidWindow()Description copied from interface:SharingPolicyReturns the time range before and after the current reservation considered by this policy. In particular, this informs the archival process for thePlan, i.e., reservations regarding times before (now - validWindow) can be deleted.- Specified by:
getValidWindowin interfaceSharingPolicy- Returns:
- validWindow the window of validity considered by the policy.
-
init
Description copied from interface:SharingPolicyInitialize this policy.- Specified by:
initin interfaceSharingPolicy- Parameters:
planQueuePath- the name of the queue for this planconf- the system configuration
-
availableResources
public RLESparseResourceAllocation availableResources(RLESparseResourceAllocation available, Plan plan, String user, org.apache.hadoop.yarn.api.records.ReservationId oldId, long start, long end) throws PlanningException Description copied from interface:SharingPolicyThis method provide a (partial) instantaneous validation by applying business rules (such as max number of parallel containers allowed for a user). To provide the agent with more feedback the returned parameter is expressed in number of containers that can be fit in this time according to the business rules.- Specified by:
availableResourcesin interfaceSharingPolicy- Parameters:
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 querying- Returns:
- the available resources expressed as a
RLESparseResourceAllocation - Throws:
PlanningException- throws if the request is not valid
-