public class InMemoryPlan extends Object implements Plan
| Constructor and 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,
            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,
            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,
            String queueName,
            Planner replanner,
            boolean getMoveOnExpiry,
            RMContext rmContext) | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | addReservation(ReservationAllocation reservation,
              boolean isRecovering)Add a new  ReservationAllocationto 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  ReservationAllocationfrom the plan identified
 uniquely by itsReservationId. | 
| Set<ReservationAllocation> | getAllReservations()Gets all the reservations in the plan | 
| RLESparseResourceAllocation | getAvailableResourceOverTime(String user,
                            org.apache.hadoop.yarn.api.records.ReservationId oldId,
                            long start,
                            long end,
                            long period)This method returns the amount of resources available to a given user
 (optionally if removing a certain reservation) over the start-end time
 range. | 
| RLESparseResourceAllocation | getConsumptionForUserOverTime(String user,
                             long start,
                             long end)This method returns a RLE encoded view of the user reservation utilization
 between start and end time. | 
| RLESparseResourceAllocation | getCumulativeLoadOverTime(long start,
                         long end)Get the cumulative load over a time interval. | 
| long | getEarliestStartTime()Gets the time (UTC in ms) at which the first reservation starts | 
| long | getLastEndTime()Returns the time (UTC in ms) at which the last reservation terminates | 
| org.apache.hadoop.yarn.api.records.Resource | getMaximumAllocation()Returns the single largest  Resourceallocation 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  Resourceallocation that can be
 reserved in this plan | 
| boolean | getMoveOnExpiry()Instructs the  PlanFolloweron what to do for applications
 which are still running when the reservation is expiring (move-to-default
 vs kill) | 
| QueueMetrics | getQueueMetrics()Return the  QueueMetricsfor the queue in theResourceSchedulercorresponding to this plan | 
| String | getQueueName()Return the name of the queue in the  ResourceSchedulercorresponding
 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  ReservationAgentconfigured for this plan that is
 responsible for optimally placing various reservation requests | 
| ReservationAllocation | getReservationById(org.apache.hadoop.yarn.api.records.ReservationId reservationID)Return a  ReservationAllocationidentified by itsReservationId | 
| Set<ReservationAllocation> | getReservationByUserAtTime(String user,
                          long t)Return a set of  ReservationAllocationthat belongs to a certain
 user and overlaps time t. | 
| RLESparseResourceAllocation | getReservationCountForUserOverTime(String user,
                                  long start,
                                  long end)This method returns a RLE encoded view of the user reservation count
 utilization between start and end time. | 
| Set<ReservationAllocation> | getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID,
               ReservationInterval interval)Return a set of  ReservationAllocationidentified by any user. | 
| Set<ReservationAllocation> | getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID,
               ReservationInterval interval,
               String user)Return a set of  ReservationAllocationidentified by the user who
 made the reservation. | 
| Set<ReservationAllocation> | getReservationsAtTime(long tick)Gets all the active reservations at the specified point of time | 
| org.apache.hadoop.yarn.util.resource.ResourceCalculator | getResourceCalculator()Returns the system  ResourceCalculator | 
| SharingPolicy | getSharingPolicy()Return the configured  SharingPolicythat 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()Returns the overall capacity in terms of  Resourceassigned to this
 plan (typically will correspond to the absolute capacity of the
 corresponding queue). | 
| org.apache.hadoop.yarn.api.records.Resource | getTotalCommittedResources(long t)Returns the total  Resourcereserved for all users at the specified
 time | 
| void | setTotalCapacity(org.apache.hadoop.yarn.api.records.Resource cap)Sets the overall capacity in terms of  Resourceassigned to this
 plan. | 
| String | toCumulativeString() | 
| String | toString() | 
| boolean | updateReservation(ReservationAllocation reservation)Updates an existing  ReservationAllocationin 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, 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, 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, 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 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 Set<ReservationAllocation> getReservationsAtTime(long tick)
tick - the time (UTC in ms) for which the active reservations are
          requestedpublic 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(String user, long start, long end)
user - the user being consideredstart - start of the time interval.end - end of the time interval.public RLESparseResourceAllocation getConsumptionForUserOverTime(String user, long start, long end)
user - the user being consideredstart - start of the time interval.end - end of the time interval.public org.apache.hadoop.yarn.api.records.Resource getTotalCommittedResources(long t)
Resource reserved for all users at the specified
 timet - the time (UTC in ms) for which the reserved resources are
          requestedResource reserved for all users at the specified
         timepublic Set<ReservationAllocation> getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID, ReservationInterval interval)
ReservationAllocation identified by any user.reservationID - the unqiue id to identify the
          ReservationAllocationinterval - the time interval used to retrieve the reservation
          allocations from. Only reservations with start time no greater
          than the interval end time, and end time no less than the interval
          start time will be selected.ReservationAllocation identified by any userpublic Set<ReservationAllocation> getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID, ReservationInterval interval, String user)
ReservationAllocation identified by the user who
 made the reservation.reservationID - the unqiue id to identify the
          ReservationAllocationinterval - the time interval used to retrieve the reservation
          allocations from. Only reservations with start time no greater
          than the interval end time, and end time no less than the interval
          start time will be selected.user - the user to retrieve the reservation allocation from.ReservationAllocation identified by the user who
         made the reservationpublic ReservationAllocation getReservationById(org.apache.hadoop.yarn.api.records.ReservationId reservationID)
ReservationAllocation identified by its
 ReservationIdreservationID - the unique id to identify the
          ReservationAllocationReservationAllocation identified by the specified idpublic org.apache.hadoop.yarn.api.records.Resource getTotalCapacity()
Resource assigned to this
 plan (typically will correspond to the absolute capacity of the
 corresponding queue).Resource assigned to this
         planpublic RLESparseResourceAllocation getAvailableResourceOverTime(String user, org.apache.hadoop.yarn.api.records.ReservationId oldId, long start, long end, long period) throws PlanningException
user - the user being consideredoldId - the identifier of the existing reservationstart - start of the time interval.end - end of the time interval.period - the ms periodicty for this request (loop and pick min till
          maxPeriodicity)PlanningException - if operation is unsuccessfulpublic 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 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 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 Set<ReservationAllocation> getReservationByUserAtTime(String user, long t)
ReservationAllocation that belongs to a certain
 user and overlaps time t.user - the user being consideredt - the instant in time being consideredReservationAllocations for this user at this
         timepublic RLESparseResourceAllocation getCumulativeLoadOverTime(long start, long end) throws PlanningException
start - start of the time interval.end - end of the time interval.PlanningException - if operation is unsuccessfulCopyright © 2008–2023 Apache Software Foundation. All rights reserved.