org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity
Interface CSQueue

All Superinterfaces:
Queue
All Known Implementing Classes:
LeafQueue, ParentQueue

@InterfaceStability.Stable
@InterfaceAudience.Private
public interface CSQueue
extends Queue

CSQueue represents a node in the tree of hierarchical queues in the CapacityScheduler.


Method Summary
 CSAssignment assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource, SchedulerNode node)
          Assign containers to applications in the queue or it's children (if any).
 void completedContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, SchedulerApp application, SchedulerNode node, RMContainer container, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus, RMContainerEventType event)
          A container assigned to the queue has completed.
 void finishApplication(SchedulerApp application, String queue)
          An application submitted to this queue has finished.
 float getAbsoluteCapacity()
          Get capacity of the parent of the queue as a function of the cumulative capacity in the cluster.
 float getAbsoluteMaximumCapacity()
          Get maximum-capacity of the queue as a funciton of the cumulative capacity of the cluster.
 ActiveUsersManager getActiveUsersManager()
          Get the ActiveUsersManager for the queue.
 float getCapacity()
          Get the configured capacity of the queue.
 List<CSQueue> getChildQueues()
          Get child queues
 float getMaximumCapacity()
          Get the configured maximum-capacity of the queue.
 int getNumApplications()
          Get the number of applications in the queue.
 CSQueue getParent()
          Get the parent Queue.
 String getQueueName()
          Get the queue name.
 String getQueuePath()
          Get the full name of the queue, including the heirarchy.
 org.apache.hadoop.yarn.api.records.QueueState getState()
          Get the current run-state of the queue
 float getUsedCapacity()
          Get the currently utilized capacity of the queue relative to it's parent queue.
 org.apache.hadoop.yarn.api.records.Resource getUsedResources()
          Get the currently utilized resources in the cluster by the queue and children (if any).
 float getUtilization()
          Get the current utilization of the queue and it's children (if any).
 boolean hasAccess(org.apache.hadoop.yarn.api.records.QueueACL acl, org.apache.hadoop.security.UserGroupInformation user)
          Check if the user has permission to perform the operation
 void recoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, SchedulerApp application, org.apache.hadoop.yarn.api.records.Container container)
          Recover the state of the queue
 void reinitialize(CSQueue queue, org.apache.hadoop.yarn.api.records.Resource clusterResource)
          Reinitialize the queue.
 void setUsedCapacity(float usedCapacity)
          Set used capacity of the queue.
 void setUtilization(float utilization)
          Get the current utilization of the queue.
 void submitApplication(SchedulerApp application, String user, String queue)
          Submit a new application to the queue.
 void updateClusterResource(org.apache.hadoop.yarn.api.records.Resource clusterResource)
          Update the cluster resource for queues as we add/remove nodes
 
Methods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue
getMetrics, getQueueAcls, getQueueInfo, getQueueUserAclInfo
 

Method Detail

getParent

CSQueue getParent()
Get the parent Queue.

Returns:
the parent queue

getQueueName

String getQueueName()
Get the queue name.

Specified by:
getQueueName in interface Queue
Returns:
the queue name

getQueuePath

String getQueuePath()
Get the full name of the queue, including the heirarchy.

Returns:
the full name of the queue

getCapacity

float getCapacity()
Get the configured capacity of the queue.

Returns:
queue capacity

getAbsoluteCapacity

float getAbsoluteCapacity()
Get capacity of the parent of the queue as a function of the cumulative capacity in the cluster.

Returns:
capacity of the parent of the queue as a function of the cumulative capacity in the cluster

getMaximumCapacity

float getMaximumCapacity()
Get the configured maximum-capacity of the queue.

Returns:
the configured maximum-capacity of the queue

getAbsoluteMaximumCapacity

float getAbsoluteMaximumCapacity()
Get maximum-capacity of the queue as a funciton of the cumulative capacity of the cluster.

Returns:
maximum-capacity of the queue as a funciton of the cumulative capacity of the cluster

getUsedCapacity

float getUsedCapacity()
Get the currently utilized capacity of the queue relative to it's parent queue.

Returns:
the currently utilized capacity of the queue relative to it's parent queue

setUsedCapacity

void setUsedCapacity(float usedCapacity)
Set used capacity of the queue.

Parameters:
usedCapacity - used capacity of the queue

getUsedResources

org.apache.hadoop.yarn.api.records.Resource getUsedResources()
Get the currently utilized resources in the cluster by the queue and children (if any).

Returns:
used resources by the queue and it's children

getUtilization

float getUtilization()
Get the current utilization of the queue and it's children (if any). Utilization is defined as the ratio of used-capacity over configured-capacity of the queue.

Returns:
queue utilization

setUtilization

void setUtilization(float utilization)
Get the current utilization of the queue.

Parameters:
utilization - queue utilization

getState

org.apache.hadoop.yarn.api.records.QueueState getState()
Get the current run-state of the queue

Returns:
current run-state

getChildQueues

List<CSQueue> getChildQueues()
Get child queues

Returns:
child queues

hasAccess

boolean hasAccess(org.apache.hadoop.yarn.api.records.QueueACL acl,
                  org.apache.hadoop.security.UserGroupInformation user)
Check if the user has permission to perform the operation

Parameters:
acl - ACL
user - user
Returns:
true if the user has the permission, false otherwise

submitApplication

void submitApplication(SchedulerApp application,
                       String user,
                       String queue)
                       throws org.apache.hadoop.security.AccessControlException
Submit a new application to the queue.

Parameters:
application - application being submitted
user - user who submitted the application
queue - queue to which the application is submitted
Throws:
org.apache.hadoop.security.AccessControlException

finishApplication

void finishApplication(SchedulerApp application,
                       String queue)
An application submitted to this queue has finished.

Parameters:
application -
queue - application queue

assignContainers

CSAssignment assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                              SchedulerNode node)
Assign containers to applications in the queue or it's children (if any).

Parameters:
clusterResource - the resource of the cluster.
node - node on which resources are available
Returns:
the assignment

completedContainer

void completedContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                        SchedulerApp application,
                        SchedulerNode node,
                        RMContainer container,
                        org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus,
                        RMContainerEventType event)
A container assigned to the queue has completed.

Parameters:
clusterResource - the resource of the cluster
application - application to which the container was assigned
node - node on which the container completed
container - completed container, null if it was just a reservation
containerStatus - ContainerStatus for the completed container
event - event to be sent to the container

getNumApplications

int getNumApplications()
Get the number of applications in the queue.

Returns:
number of applications

reinitialize

void reinitialize(CSQueue queue,
                  org.apache.hadoop.yarn.api.records.Resource clusterResource)
                  throws IOException
Reinitialize the queue.

Parameters:
queue - new queue to re-initalize from
clusterResource - resources in the cluster
Throws:
IOException

updateClusterResource

void updateClusterResource(org.apache.hadoop.yarn.api.records.Resource clusterResource)
Update the cluster resource for queues as we add/remove nodes

Parameters:
clusterResource - the current cluster resource

getActiveUsersManager

ActiveUsersManager getActiveUsersManager()
Get the ActiveUsersManager for the queue.

Returns:
the ActiveUsersManager for the queue

recoverContainer

void recoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                      SchedulerApp application,
                      org.apache.hadoop.yarn.api.records.Container container)
Recover the state of the queue

Parameters:
clusterResource - the resource of the cluster
application - the application for which the container was allocated
container - the container that was recovered.


Copyright © 2012 Apache Software Foundation. All Rights Reserved.