org.apache.hadoop.yarn.server.resourcemanager.reservation
Class GreedyReservationAgent

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.reservation.GreedyReservationAgent
All Implemented Interfaces:
ReservationAgent

public class GreedyReservationAgent
extends Object
implements ReservationAgent

This Agent employs a simple greedy placement strategy, placing the various stages of a ReservationRequest 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).


Constructor Summary
GreedyReservationAgent()
           
 
Method Summary
 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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GreedyReservationAgent

public GreedyReservationAgent()
Method Detail

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: ReservationAgent
Create a reservation for the user that abides by the specified contract

Specified by:
createReservation in interface ReservationAgent
Parameters:
reservationId - the identifier of the reservation to be created.
user - the user who wants to create the reservation
plan - the Plan to which the reservation must be fitted
contract - 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: ReservationAgent
Update a reservation for the user that abides by the specified contract

Specified by:
updateReservation in interface ReservationAgent
Parameters:
reservationId - the identifier of the reservation to be updated
user - the user who wants to create the session
plan - the Plan to which the reservation must be fitted
contract - 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: ReservationAgent
Delete an user reservation

Specified by:
deleteReservation in interface ReservationAgent
Parameters:
reservationId - the identifier of the reservation to be deleted
user - the user who wants to create the reservation
plan - 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


Copyright © 2014 Apache Software Foundation. All Rights Reserved.