Plan, PlanContext, PlanEditpublic class InMemoryPlan extends java.lang.Object implements Plan
| Constructor | Description |
|---|---|
InMemoryPlan(QueueMetrics queueMetrics,
SharingPolicy policy,
ReservationAgent agent,
org.apache.hadoop.yarn.api.records.Resource totalCapacity,
long step,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc,
org.apache.hadoop.yarn.api.records.Resource minAlloc,
org.apache.hadoop.yarn.api.records.Resource maxAlloc,
java.lang.String queueName,
Planner replanner,
boolean getMoveOnExpiry,
long maxPeriodicity,
RMContext rmContext) |
|
InMemoryPlan(QueueMetrics queueMetrics,
SharingPolicy policy,
ReservationAgent agent,
org.apache.hadoop.yarn.api.records.Resource totalCapacity,
long step,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc,
org.apache.hadoop.yarn.api.records.Resource minAlloc,
org.apache.hadoop.yarn.api.records.Resource maxAlloc,
java.lang.String queueName,
Planner replanner,
boolean getMoveOnExpiry,
long maxPeriodicty,
RMContext rmContext,
org.apache.hadoop.yarn.util.Clock clock) |
|
InMemoryPlan(QueueMetrics queueMetrics,
SharingPolicy policy,
ReservationAgent agent,
org.apache.hadoop.yarn.api.records.Resource totalCapacity,
long step,
org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc,
org.apache.hadoop.yarn.api.records.Resource minAlloc,
org.apache.hadoop.yarn.api.records.Resource maxAlloc,
java.lang.String queueName,
Planner replanner,
boolean getMoveOnExpiry,
RMContext rmContext) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
addReservation(ReservationAllocation reservation,
boolean isRecovering) |
Add a new
ReservationAllocation to the plan. |
void |
archiveCompletedReservations(long tick) |
Method invoked to garbage collect old reservations.
|
boolean |
deleteReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationID) |
Delete an existing
ReservationAllocation from the plan identified
uniquely by its ReservationId. |
java.util.Set<ReservationAllocation> |
getAllReservations() |
|
RLESparseResourceAllocation |
getAvailableResourceOverTime(java.lang.String user,
org.apache.hadoop.yarn.api.records.ReservationId oldId,
long start,
long end,
long period) |
|
RLESparseResourceAllocation |
getConsumptionForUserOverTime(java.lang.String user,
long start,
long end) |
|
RLESparseResourceAllocation |
getCumulativeLoadOverTime(long start,
long end) |
|
long |
getEarliestStartTime() |
|
long |
getLastEndTime() |
|
org.apache.hadoop.yarn.api.records.Resource |
getMaximumAllocation() |
Returns the single largest
Resource allocation that can be reserved
in this plan |
long |
getMaximumPeriodicity() |
Returns the maximum periodicity allowed in a recurrence expression
for reservations of a particular plan.
|
org.apache.hadoop.yarn.api.records.Resource |
getMinimumAllocation() |
Returns the single smallest
Resource allocation that can be
reserved in this plan |
boolean |
getMoveOnExpiry() |
Instructs the
PlanFollower on what to do for applications
which are still running when the reservation is expiring (move-to-default
vs kill) |
QueueMetrics |
getQueueMetrics() |
Return the
QueueMetrics for the queue in the
ResourceScheduler corresponding to this plan |
java.lang.String |
getQueueName() |
Return the name of the queue in the
ResourceScheduler corresponding
to this plan |
Planner |
getReplanner() |
Return an instance of a
Planner, which will be invoked in response
to unexpected reduction in the resources of this plan |
ReservationAgent |
getReservationAgent() |
Return the
ReservationAgent configured for this plan that is
responsible for optimally placing various reservation requests |
ReservationAllocation |
getReservationById(org.apache.hadoop.yarn.api.records.ReservationId reservationID) |
|
java.util.Set<ReservationAllocation> |
getReservationByUserAtTime(java.lang.String user,
long t) |
|
RLESparseResourceAllocation |
getReservationCountForUserOverTime(java.lang.String user,
long start,
long end) |
|
java.util.Set<ReservationAllocation> |
getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID,
ReservationInterval interval) |
|
java.util.Set<ReservationAllocation> |
getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID,
ReservationInterval interval,
java.lang.String user) |
|
java.util.Set<ReservationAllocation> |
getReservationsAtTime(long tick) |
|
org.apache.hadoop.yarn.util.resource.ResourceCalculator |
getResourceCalculator() |
Returns the system
ResourceCalculator |
SharingPolicy |
getSharingPolicy() |
Return the configured
SharingPolicy that governs the sharing of the
resources of the plan between its various users |
long |
getStep() |
Returns the configured "step" or granularity of time of the plan in millis.
|
org.apache.hadoop.yarn.api.records.Resource |
getTotalCapacity() |
|
org.apache.hadoop.yarn.api.records.Resource |
getTotalCommittedResources(long t) |
|
void |
setTotalCapacity(org.apache.hadoop.yarn.api.records.Resource cap) |
Sets the overall capacity in terms of
Resource assigned to this
plan. |
java.lang.String |
toCumulativeString() |
|
java.lang.String |
toString() |
|
boolean |
updateReservation(ReservationAllocation reservation) |
Updates an existing
ReservationAllocation in the plan. |
public InMemoryPlan(QueueMetrics queueMetrics, SharingPolicy policy, ReservationAgent agent, org.apache.hadoop.yarn.api.records.Resource totalCapacity, long step, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc, org.apache.hadoop.yarn.api.records.Resource minAlloc, org.apache.hadoop.yarn.api.records.Resource maxAlloc, java.lang.String queueName, Planner replanner, boolean getMoveOnExpiry, RMContext rmContext)
public InMemoryPlan(QueueMetrics queueMetrics, SharingPolicy policy, ReservationAgent agent, org.apache.hadoop.yarn.api.records.Resource totalCapacity, long step, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc, org.apache.hadoop.yarn.api.records.Resource minAlloc, org.apache.hadoop.yarn.api.records.Resource maxAlloc, java.lang.String queueName, Planner replanner, boolean getMoveOnExpiry, long maxPeriodicity, RMContext rmContext)
public InMemoryPlan(QueueMetrics queueMetrics, SharingPolicy policy, ReservationAgent agent, org.apache.hadoop.yarn.api.records.Resource totalCapacity, long step, org.apache.hadoop.yarn.util.resource.ResourceCalculator resCalc, org.apache.hadoop.yarn.api.records.Resource minAlloc, org.apache.hadoop.yarn.api.records.Resource maxAlloc, java.lang.String queueName, Planner replanner, boolean getMoveOnExpiry, long maxPeriodicty, RMContext rmContext, org.apache.hadoop.yarn.util.Clock clock)
public QueueMetrics getQueueMetrics()
PlanContextQueueMetrics for the queue in the
ResourceScheduler corresponding to this plangetQueueMetrics in interface PlanContextQueueMetrics for the queue in the
ResourceScheduler corresponding to this planpublic java.util.Set<ReservationAllocation> getAllReservations()
public boolean addReservation(ReservationAllocation reservation, boolean isRecovering) throws PlanningException
PlanEditReservationAllocation to the plan.addReservation in interface PlanEditreservation - the ReservationAllocation to be added to the
planisRecovering - flag to indicate if reservation is being added as part
of failover or notPlanningException - if addition is unsuccessfulpublic boolean updateReservation(ReservationAllocation reservation) throws PlanningException
PlanEditReservationAllocation in the plan. This is
required for re-negotiation.updateReservation in interface PlanEditreservation - the ReservationAllocation to be updated the planPlanningException - if update is unsuccessfulpublic boolean deleteReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationID)
PlanEditReservationAllocation from the plan identified
uniquely by its ReservationId. This will generally be used for
garbage collection.deleteReservation in interface PlanEditreservationID - the ReservationAllocation to be deleted from
the plan identified uniquely by its ReservationIdpublic void archiveCompletedReservations(long tick)
PlanEditarchiveCompletedReservations in interface PlanEdittick - the current time from which the archival window is computedpublic java.util.Set<ReservationAllocation> getReservationsAtTime(long tick)
public long getStep()
PlanContextgetStep in interface PlanContextpublic SharingPolicy getSharingPolicy()
PlanContextSharingPolicy that governs the sharing of the
resources of the plan between its various usersgetSharingPolicy in interface PlanContextSharingPolicy that governs the sharing of
the resources of the plan between its various userspublic ReservationAgent getReservationAgent()
PlanContextReservationAgent configured for this plan that is
responsible for optimally placing various reservation requestsgetReservationAgent in interface PlanContextReservationAgent configured for this planpublic RLESparseResourceAllocation getReservationCountForUserOverTime(java.lang.String user, long start, long end)
public RLESparseResourceAllocation getConsumptionForUserOverTime(java.lang.String user, long start, long end)
public org.apache.hadoop.yarn.api.records.Resource getTotalCommittedResources(long t)
public java.util.Set<ReservationAllocation> getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID, ReservationInterval interval)
public java.util.Set<ReservationAllocation> getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID, ReservationInterval interval, java.lang.String user)
public ReservationAllocation getReservationById(org.apache.hadoop.yarn.api.records.ReservationId reservationID)
public org.apache.hadoop.yarn.api.records.Resource getTotalCapacity()
public RLESparseResourceAllocation getAvailableResourceOverTime(java.lang.String user, org.apache.hadoop.yarn.api.records.ReservationId oldId, long start, long end, long period) throws PlanningException
PlanningExceptionpublic org.apache.hadoop.yarn.api.records.Resource getMinimumAllocation()
PlanContextResource allocation that can be
reserved in this plangetMinimumAllocation in interface PlanContextResource allocation that can be
reserved in this planpublic void setTotalCapacity(org.apache.hadoop.yarn.api.records.Resource cap)
PlanEditResource assigned to this
plan.setTotalCapacity in interface PlanEditcap - the overall capacity in terms of Resource assigned
to this planpublic long getEarliestStartTime()
public long getLastEndTime()
public org.apache.hadoop.yarn.util.resource.ResourceCalculator getResourceCalculator()
PlanContextResourceCalculatorgetResourceCalculator in interface PlanContextResourceCalculatorpublic java.lang.String getQueueName()
PlanContextResourceScheduler corresponding
to this plangetQueueName in interface PlanContextResourceScheduler
corresponding to this planpublic org.apache.hadoop.yarn.api.records.Resource getMaximumAllocation()
PlanContextResource allocation that can be reserved
in this plangetMaximumAllocation in interface PlanContextResource allocation that can be reserved
in this planpublic long getMaximumPeriodicity()
PlanContextgetMaximumPeriodicity in interface PlanContextpublic java.lang.String toCumulativeString()
public Planner getReplanner()
PlanContextPlanner, which will be invoked in response
to unexpected reduction in the resources of this plangetReplanner in interface PlanContextPlanner, which will be invoked in response
to unexpected reduction in the resources of this planpublic boolean getMoveOnExpiry()
PlanContextPlanFollower on what to do for applications
which are still running when the reservation is expiring (move-to-default
vs kill)getMoveOnExpiry in interface PlanContextpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Set<ReservationAllocation> getReservationByUserAtTime(java.lang.String user, long t)
public RLESparseResourceAllocation getCumulativeLoadOverTime(long start, long end) throws PlanningException
PlanningExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.