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

All Superinterfaces:
PlanContext
All Known Subinterfaces:
Plan, PlanEdit

public interface PlanView
extends PlanContext

This interface provides a read-only view on the allocations made in this plan. This methods are used for example by ReservationAgents to determine the free resources in a certain point in time, and by PlanFollowerPolicy to publish this plan to the scheduler.


Method Summary
 Set<ReservationAllocation> getAllReservations()
          Gets all the reservations in the plan
 org.apache.hadoop.yarn.api.records.Resource getConsumptionForUser(String user, long tick)
          Returns the total Resource reserved for a given user at the specified time
 long getEarliestStartTime()
          Gets the time (UTC in ms) at which the first reservation starts
 long getLastEndTime()
          Returns the time (UTC in ms) at which the last reservation terminates
 ReservationAllocation getReservationById(org.apache.hadoop.yarn.api.records.ReservationId reservationID)
          Return a ReservationAllocation identified by its ReservationId
 Set<ReservationAllocation> getReservationsAtTime(long tick)
          Gets all the active reservations at the specified point of time
 org.apache.hadoop.yarn.api.records.Resource getTotalCapacity()
          Returns the overall capacity in terms of Resource assigned to this plan (typically will correspond to the absolute capacity of the corresponding queue).
 org.apache.hadoop.yarn.api.records.Resource getTotalCommittedResources(long tick)
          Returns the total Resource reserved for all users at the specified time
 
Methods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.reservation.PlanContext
getMaximumAllocation, getMinimumAllocation, getMoveOnExpiry, getQueueMetrics, getQueueName, getReplanner, getReservationAgent, getResourceCalculator, getSharingPolicy, getStep
 

Method Detail

getReservationById

ReservationAllocation getReservationById(org.apache.hadoop.yarn.api.records.ReservationId reservationID)
Return a ReservationAllocation identified by its ReservationId

Parameters:
reservationID - the unique id to identify the ReservationAllocation
Returns:
ReservationAllocation identified by the specified id

getReservationsAtTime

Set<ReservationAllocation> getReservationsAtTime(long tick)
Gets all the active reservations at the specified point of time

Parameters:
tick - the time (UTC in ms) for which the active reservations are requested
Returns:
set of active reservations at the specified time

getAllReservations

Set<ReservationAllocation> getAllReservations()
Gets all the reservations in the plan

Returns:
set of all reservations handled by this Plan

getTotalCommittedResources

org.apache.hadoop.yarn.api.records.Resource getTotalCommittedResources(long tick)
Returns the total Resource reserved for all users at the specified time

Parameters:
tick - the time (UTC in ms) for which the reserved resources are requested
Returns:
the total Resource reserved for all users at the specified time

getConsumptionForUser

org.apache.hadoop.yarn.api.records.Resource getConsumptionForUser(String user,
                                                                  long tick)
Returns the total Resource reserved for a given user at the specified time

Parameters:
user - the user who made the reservation(s)
tick - the time (UTC in ms) for which the reserved resources are requested
Returns:
the total Resource reserved for a given user at the specified time

getTotalCapacity

org.apache.hadoop.yarn.api.records.Resource getTotalCapacity()
Returns the overall capacity in terms of Resource assigned to this plan (typically will correspond to the absolute capacity of the corresponding queue).

Returns:
the overall capacity in terms of Resource assigned to this plan

getEarliestStartTime

long getEarliestStartTime()
Gets the time (UTC in ms) at which the first reservation starts

Returns:
the time (UTC in ms) at which the first reservation starts

getLastEndTime

long getLastEndTime()
Returns the time (UTC in ms) at which the last reservation terminates

Returns:
the time (UTC in ms) at which the last reservation terminates


Copyright © 2014 Apache Software Foundation. All Rights Reserved.