Class GreedyReservationAgent
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.reservation.planning.GreedyReservationAgent
- All Implemented Interfaces:
ReservationAgent
This Agent employs a simple greedy placement strategy, placing the various
stages of a
ReservationDefinition from the deadline moving backward
towards the arrival. This allows jobs with earlier deadline to be scheduled
greedily as well. Combined with an opportunistic anticipation of work if the
cluster is not fully utilized also seems to provide good latency for
best-effort jobs (i.e., jobs running without a reservation).
This agent does not account for locality and only consider container
granularity for validation purposes (i.e., you can't exceed max-container
size).-
Field Summary
Fields inherited from interface org.apache.hadoop.yarn.server.resourcemanager.reservation.planning.ReservationAgent
DEFAULT_GREEDY_FAVOR_EARLY_ALLOCATION, FAVOR_EARLY_ALLOCATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancreateReservation(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 contractbooleandeleteReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId, String user, Plan plan) Delete an user reservationvoidinit(org.apache.hadoop.conf.Configuration conf) Init configuration.booleanbooleanupdateReservation(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
-
Constructor Details
-
GreedyReservationAgent
public GreedyReservationAgent()
-
-
Method Details
-
init
public void init(org.apache.hadoop.conf.Configuration conf) Description copied from interface:ReservationAgentInit configuration.- Specified by:
initin interfaceReservationAgent- Parameters:
conf- Configuration
-
isAllocateLeft
public boolean isAllocateLeft() -
createReservation
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 Description copied from interface:ReservationAgentCreate a reservation for the user that abides by the specified contract- Specified by:
createReservationin interfaceReservationAgent- Parameters:
reservationId- 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 session- Returns:
- whether the create operation was successful or not
- Throws:
PlanningException- if the session cannot be fitted into the plan
-
updateReservation
public boolean updateReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId, String user, Plan plan, org.apache.hadoop.yarn.api.records.ReservationDefinition contract) throws PlanningException Description copied from interface:ReservationAgentUpdate a reservation for the user that abides by the specified contract- Specified by:
updateReservationin interfaceReservationAgent- Parameters:
reservationId- 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 reservation- Returns:
- whether the update operation was successful or not
- Throws:
PlanningException- if the reservation cannot be fitted into the plan
-
deleteReservation
public boolean deleteReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId, String user, Plan plan) throws PlanningException Description copied from interface:ReservationAgentDelete an user reservation- Specified by:
deleteReservationin interfaceReservationAgent- Parameters:
reservationId- the identifier of the reservation to be deleteduser- the user who wants to create the reservationplan- the Plan to which the session must be fitted- Returns:
- whether the delete operation was successful or not
- Throws:
PlanningException- if the reservation cannot be fitted into the plan
-