org.apache.hadoop.yarn.server.resourcemanager.reservation
Interface ReservationSystem

All Known Implementing Classes:
AbstractReservationSystem, CapacityReservationSystem

@InterfaceAudience.LimitedPrivate(value="yarn")
@InterfaceStability.Unstable
public interface ReservationSystem

This interface is the one implemented by any system that wants to support Reservations i.e. make Resource allocations in future. Implementors need to bootstrap all configured Plans in the active ResourceScheduler along with their corresponding ReservationAgent and SharingPolicy. It is also responsible for managing the PlanFollower to ensure the Plans are in sync with the ResourceScheduler.


Method Summary
 Map<String,Plan> getAllPlans()
          Return a map containing all the plans known to this ReservationSystem (useful for UI)
 org.apache.hadoop.yarn.api.records.ReservationId getNewReservationId()
          Get a new unique ReservationId.
 Plan getPlan(String planName)
          Get an existing Plan that has been initialized.
 long getPlanFollowerTimeStep()
          Return the time step (ms) at which the PlanFollower is invoked
 String getQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId)
          Get the Queue that an existing ReservationId is associated with.
 void reinitialize(org.apache.hadoop.conf.Configuration conf, RMContext rmContext)
          Re-initialize the ReservationSystem.
 void setQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId, String queueName)
          Set the Queue that an existing ReservationId should be associated with.
 void setRMContext(RMContext rmContext)
          Set RMContext for ReservationSystem.
 void synchronizePlan(String planName)
          Invokes PlanFollower to synchronize the specified Plan with the ResourceScheduler
 

Method Detail

setRMContext

void setRMContext(RMContext rmContext)
Set RMContext for ReservationSystem. This method should be called immediately after instantiating a reservation system once.

Parameters:
rmContext - created by ResourceManager

reinitialize

void reinitialize(org.apache.hadoop.conf.Configuration conf,
                  RMContext rmContext)
                  throws org.apache.hadoop.yarn.exceptions.YarnException
Re-initialize the ReservationSystem.

Parameters:
conf - configuration
rmContext - current context of the ResourceManager
Throws:
org.apache.hadoop.yarn.exceptions.YarnException

getPlan

Plan getPlan(String planName)
Get an existing Plan that has been initialized.

Parameters:
planName - the name of the Plan
Returns:
the Plan identified by name

getAllPlans

Map<String,Plan> getAllPlans()
Return a map containing all the plans known to this ReservationSystem (useful for UI)

Returns:
a Map of Plan names and Plan objects

synchronizePlan

void synchronizePlan(String planName)
Invokes PlanFollower to synchronize the specified Plan with the ResourceScheduler

Parameters:
planName - the name of the Plan to be synchronized

getPlanFollowerTimeStep

long getPlanFollowerTimeStep()
Return the time step (ms) at which the PlanFollower is invoked

Returns:
the time step (ms) at which the PlanFollower is invoked

getNewReservationId

org.apache.hadoop.yarn.api.records.ReservationId getNewReservationId()
Get a new unique ReservationId.

Returns:
a new unique ReservationId

getQueueForReservation

String getQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId)
Get the Queue that an existing ReservationId is associated with.

Parameters:
reservationId - the unique id of the reservation
Returns:
the name of the associated Queue

setQueueForReservation

void setQueueForReservation(org.apache.hadoop.yarn.api.records.ReservationId reservationId,
                            String queueName)
Set the Queue that an existing ReservationId should be associated with.

Parameters:
reservationId - the unique id of the reservation
queueName - the name of Queue to associate the reservation with


Copyright © 2014 Apache Software Foundation. All Rights Reserved.