public class GreedyReservationAgent extends Object implements ReservationAgent
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).Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_GREEDY_FAVOR_EARLY_ALLOCATION |
static String |
GREEDY_FAVOR_EARLY_ALLOCATION |
Constructor and Description |
---|
GreedyReservationAgent() |
GreedyReservationAgent(org.apache.hadoop.conf.Configuration yarnConfiguration) |
Modifier and Type | Method and Description |
---|---|
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
|
boolean |
isAllocateLeft() |
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
|
public static final String GREEDY_FAVOR_EARLY_ALLOCATION
public static final boolean DEFAULT_GREEDY_FAVOR_EARLY_ALLOCATION
public GreedyReservationAgent()
public GreedyReservationAgent(org.apache.hadoop.conf.Configuration yarnConfiguration)
public boolean isAllocateLeft()
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
ReservationAgent
createReservation
in interface ReservationAgent
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
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
ReservationAgent
updateReservation
in interface ReservationAgent
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
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
ReservationAgent
deleteReservation
in interface ReservationAgent
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 fittedPlanningException
- if the reservation cannot be fitted into the planCopyright © 2017 Apache Software Foundation. All Rights Reserved.