public interface Plan extends PlanContext, PlanEdit
ReservationDefinition
that have been
previously accepted will be honored.
ReservationDefinition
submitted by the users through the RM public
APIs are passed to appropriate ReservationAgent
s, which in turn will
consult the Plan (via the PlanView
interface) and try to determine
whether there are sufficient resources available in this Plan to satisfy the
temporal and resource constraints of a ReservationDefinition
. If a
valid allocation is found the agent will try to store it in the plan (via the
PlanEdit
interface). Upon success the system return to the user a
positive acknowledgment, and a reservation identifier to be later used to
access the reserved resources.
A PlanFollower
will continuously read from the Plan and will
affect the instantaneous allocation of resources among jobs running by
publishing the "current" slice of the Plan to the underlying scheduler. I.e.,
the configuration of queues/weights of the scheduler are modified to reflect
the allocations in the Plan.
As this interface have several methods we decompose them into three groups:
PlanContext
: containing configuration type information,
PlanView
read-only access to the plan state, and PlanEdit
write access to the plan state.Modifier and Type | Method and Description |
---|---|
Set<ReservationAllocation> |
getAllReservations()
Gets all the reservations in the plan
|
RLESparseResourceAllocation |
getAvailableResourceOverTime(String user,
org.apache.hadoop.yarn.api.records.ReservationId oldId,
long start,
long end,
long period)
This method returns the amount of resources available to a given user
(optionally if removing a certain reservation) over the start-end time
range.
|
RLESparseResourceAllocation |
getConsumptionForUserOverTime(String user,
long start,
long end)
This method returns a RLE encoded view of the user reservation utilization
between start and end time.
|
RLESparseResourceAllocation |
getCumulativeLoadOverTime(long start,
long end)
Get the cumulative load over a time interval.
|
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> |
getReservationByUserAtTime(String user,
long t)
Return a set of
ReservationAllocation that belongs to a certain
user and overlaps time t. |
RLESparseResourceAllocation |
getReservationCountForUserOverTime(String user,
long start,
long end)
This method returns a RLE encoded view of the user reservation count
utilization between start and end time.
|
Set<ReservationAllocation> |
getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID,
ReservationInterval interval)
Return a set of
ReservationAllocation identified by any user. |
Set<ReservationAllocation> |
getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID,
ReservationInterval interval,
String user)
Return a set of
ReservationAllocation identified by the user who
made the reservation. |
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 |
addReservation, archiveCompletedReservations, deleteReservation, setTotalCapacity, updateReservation
getMaximumAllocation, getMaximumPeriodicity, getMinimumAllocation, getMoveOnExpiry, getQueueMetrics, getQueueName, getReplanner, getReservationAgent, getResourceCalculator, getSharingPolicy, getStep
Set<ReservationAllocation> getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID, ReservationInterval interval, String user)
ReservationAllocation
identified by the user who
made the reservation.reservationID
- the unqiue id to identify the
ReservationAllocation
interval
- the time interval used to retrieve the reservation
allocations from. Only reservations with start time no greater
than the interval end time, and end time no less than the interval
start time will be selected.user
- the user to retrieve the reservation allocation from.ReservationAllocation
identified by the user who
made the reservationSet<ReservationAllocation> getReservations(org.apache.hadoop.yarn.api.records.ReservationId reservationID, ReservationInterval interval)
ReservationAllocation
identified by any user.reservationID
- the unqiue id to identify the
ReservationAllocation
interval
- the time interval used to retrieve the reservation
allocations from. Only reservations with start time no greater
than the interval end time, and end time no less than the interval
start time will be selected.ReservationAllocation
identified by any userReservationAllocation getReservationById(org.apache.hadoop.yarn.api.records.ReservationId reservationID)
ReservationAllocation
identified by its
ReservationId
reservationID
- the unique id to identify the
ReservationAllocation
ReservationAllocation
identified by the specified idSet<ReservationAllocation> getReservationByUserAtTime(String user, long t)
ReservationAllocation
that belongs to a certain
user and overlaps time t.user
- the user being consideredt
- the instant in time being consideredReservationAllocation
s for this user at this
timeSet<ReservationAllocation> getReservationsAtTime(long tick)
tick
- the time (UTC in ms) for which the active reservations are
requestedSet<ReservationAllocation> getAllReservations()
org.apache.hadoop.yarn.api.records.Resource getTotalCommittedResources(long tick)
Resource
reserved for all users at the specified
timetick
- the time (UTC in ms) for which the reserved resources are
requestedResource
reserved for all users at the specified
timeorg.apache.hadoop.yarn.api.records.Resource getTotalCapacity()
Resource
assigned to this
plan (typically will correspond to the absolute capacity of the
corresponding queue).Resource
assigned to this
planlong getEarliestStartTime()
long getLastEndTime()
RLESparseResourceAllocation getAvailableResourceOverTime(String user, org.apache.hadoop.yarn.api.records.ReservationId oldId, long start, long end, long period) throws PlanningException
user
- the user being consideredoldId
- the identifier of the existing reservationstart
- start of the time interval.end
- end of the time interval.period
- the ms periodicty for this request (loop and pick min till
maxPeriodicity)PlanningException
- if operation is unsuccessfulRLESparseResourceAllocation getReservationCountForUserOverTime(String user, long start, long end)
user
- the user being consideredstart
- start of the time interval.end
- end of the time interval.RLESparseResourceAllocation getConsumptionForUserOverTime(String user, long start, long end)
user
- the user being consideredstart
- start of the time interval.end
- end of the time interval.RLESparseResourceAllocation getCumulativeLoadOverTime(long start, long end) throws PlanningException
start
- start of the time interval.end
- end of the time interval.PlanningException
- if operation is unsuccessfulCopyright © 2008–2024 Apache Software Foundation. All rights reserved.