public abstract class PlanningAlgorithm extends Object implements ReservationAgent
DEFAULT_GREEDY_FAVOR_EARLY_ALLOCATION, FAVOR_EARLY_ALLOCATION| Constructor and Description | 
|---|
| PlanningAlgorithm() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected boolean | allocateUser(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
            String user,
            Plan plan,
            org.apache.hadoop.yarn.api.records.ReservationDefinition contract,
            ReservationAllocation oldReservation)Performs the actual allocation for a ReservationDefinition within a Plan. | 
| abstract RLESparseResourceAllocation | computeJobAllocation(Plan plan,
                    org.apache.hadoop.yarn.api.records.ReservationId reservationId,
                    org.apache.hadoop.yarn.api.records.ReservationDefinition reservation,
                    String user) | 
| boolean | createReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
                 String user,
                 Plan plan,
                 org.apache.hadoop.yarn.api.records.ReservationDefinition contract)Create a reservation for the user that abides by the specified contract | 
| boolean | deleteReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
                 String user,
                 Plan plan)Delete an user reservation | 
| protected static long | findEarliestTime(Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> sesInt) | 
| protected static long | findLatestTime(Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> sesInt) | 
| void | init(org.apache.hadoop.conf.Configuration conf)Init configuration. | 
| protected static long | stepRoundDown(long t,
             long step) | 
| protected static long | stepRoundUp(long t,
           long step) | 
| boolean | updateReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
                 String user,
                 Plan plan,
                 org.apache.hadoop.yarn.api.records.ReservationDefinition contract)Update a reservation for the user that abides by the specified contract | 
protected boolean allocateUser(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
                               String user,
                               Plan plan,
                               org.apache.hadoop.yarn.api.records.ReservationDefinition contract,
                               ReservationAllocation oldReservation)
                        throws PlanningException,
                               ContractValidationException
reservationId - the identifier of the reservationuser - the user who owns the reservationplan - the Plan to which the reservation must be fittedcontract - encapsulates the resources required by the user for his
          sessionoldReservation - the existing reservation (null if none)PlanningException - if the session cannot be fitted into the planContractValidationException - if validation failspublic abstract RLESparseResourceAllocation computeJobAllocation(Plan plan, org.apache.hadoop.yarn.api.records.ReservationId reservationId, org.apache.hadoop.yarn.api.records.ReservationDefinition reservation, String user) throws PlanningException, ContractValidationException
public boolean createReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
                                 String user,
                                 Plan plan,
                                 org.apache.hadoop.yarn.api.records.ReservationDefinition contract)
                          throws PlanningException
ReservationAgentcreateReservation in interface ReservationAgentreservationId - the identifier of the reservation to be created.user - the user who wants to create the reservationplan - the Plan to which the reservation must be fittedcontract - encapsulates the resources the user requires for his
          sessionPlanningException - if the session cannot be fitted into the planpublic boolean updateReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
                                 String user,
                                 Plan plan,
                                 org.apache.hadoop.yarn.api.records.ReservationDefinition contract)
                          throws PlanningException
ReservationAgentupdateReservation in interface ReservationAgentreservationId - the identifier of the reservation to be updateduser - the user who wants to create the sessionplan - the Plan to which the reservation must be fittedcontract - encapsulates the resources the user requires for his
          reservationPlanningException - if the reservation cannot be fitted into the planpublic boolean deleteReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
                                 String user,
                                 Plan plan)
                          throws PlanningException
ReservationAgentdeleteReservation in interface ReservationAgentreservationId - the identifier of the reservation to be deleteduser - the user who wants to create the reservationplan - the Plan to which the session must be fittedPlanningException - if the reservation cannot be fitted into the planprotected static long findEarliestTime(Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> sesInt)
protected static long findLatestTime(Map<ReservationInterval,org.apache.hadoop.yarn.api.records.Resource> sesInt)
protected static long stepRoundDown(long t,
                                    long step)
protected static long stepRoundUp(long t,
                                  long step)
public void init(org.apache.hadoop.conf.Configuration conf)
ReservationAgentinit in interface ReservationAgentconf - ConfigurationCopyright © 2008–2023 Apache Software Foundation. All rights reserved.