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

All Superinterfaces:
Queue
All Known Implementing Classes:
AbstractCSQueue, LeafQueue, ParentQueue, PlanQueue, ReservationQueue

@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, FiCaSchedulerNode node, boolean needToUnreserve)
          Assign containers to applications in the queue or it's children (if any).
 void attachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, RMContainer container)
          Attach a container to this queue
 void collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps)
          Adds all applications in the queue and its subqueues to the given collection.
 void completedContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer container, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue, boolean sortQueues)
          A container assigned to the queue has completed.
 void detachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, RMContainer container)
          Detach a container from this queue
 void finishApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String user)
          An application submitted to this queue has finished.
 void finishApplicationAttempt(FiCaSchedulerApp application, String queue)
          An application attempt submitted to this queue has finished.
 float getAbsActualCapacity()
          Get actual capacity of the queue, this may be different from configured capacity when mis-config take place, like add labels to the cluster
 float getAbsoluteCapacity()
          Get capacity of the parent of the queue as a function of the cumulative capacity in the cluster.
 float getAbsoluteCapacityByNodeLabel(String nodeLabel)
          Get absolute capacity by label of this queue can use
 float getAbsoluteMaximumCapacity()
          Get maximum-capacity of the queue as a funciton of the cumulative capacity of the cluster.
 float getAbsoluteMaximumCapacityByNodeLabel(String nodeLabel)
          Get absolute max capacity by label of this queue can use
 float getAbsoluteUsedCapacity()
          Get the current absolute used capacity of the queue relative to the entire cluster.
 ActiveUsersManager getActiveUsersManager()
          Get the ActiveUsersManager for the queue.
 float getCapacity()
          Get the configured capacity of the queue.
 float getCapacityByNodeLabel(String nodeLabel)
          Get capacity by node label
 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 current used capacity of nodes without label(s) of the queue and it's children (if any).
 org.apache.hadoop.yarn.api.records.Resource getUsedResources()
          Get the currently utilized resources which allocated at nodes without any labels in the cluster by the queue and 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 reinitialize(CSQueue newlyParsedQueue, org.apache.hadoop.yarn.api.records.Resource clusterResource)
          Reinitialize the queue.
 void setAbsoluteUsedCapacity(float absUsedCapacity)
          Set absolute used capacity of the queue.
 void setParent(CSQueue newParentQueue)
          Set the parent Queue.
 void setUsedCapacity(float usedCapacity)
          Set used capacity of the queue.
 void submitApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String user, String queue)
          Submit a new application to the queue.
 void submitApplicationAttempt(FiCaSchedulerApp application, String userName)
          Submit an application attempt 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
getAccessibleNodeLabels, getDefaultNodeLabelExpression, getMetrics, getQueueInfo, getQueueUserAclInfo, recoverContainer
 

Method Detail

getParent

CSQueue getParent()
Get the parent Queue.

Returns:
the parent queue

setParent

void setParent(CSQueue newParentQueue)
Set the parent Queue.

Parameters:
newParentQueue - new 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:
configured queue capacity

getAbsActualCapacity

float getAbsActualCapacity()
Get actual capacity of the queue, this may be different from configured capacity when mis-config take place, like add labels to the cluster

Returns:
actual 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

getAbsoluteUsedCapacity

float getAbsoluteUsedCapacity()
Get the current absolute used capacity of the queue relative to the entire cluster.

Returns:
queue absolute used capacity

setUsedCapacity

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

Parameters:
usedCapacity - used capacity of the queue

setAbsoluteUsedCapacity

void setAbsoluteUsedCapacity(float absUsedCapacity)
Set absolute used capacity of the queue.

Parameters:
absUsedCapacity - absolute used capacity of the queue

getUsedCapacity

float getUsedCapacity()
Get the current used capacity of nodes without label(s) of the queue and it's children (if any).

Returns:
queue used capacity

getUsedResources

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

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

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

Specified by:
hasAccess in interface Queue
Parameters:
acl - ACL
user - user
Returns:
true if the user has the permission, false otherwise

submitApplication

void submitApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
                       String user,
                       String queue)
                       throws org.apache.hadoop.security.AccessControlException
Submit a new application to the queue.

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

submitApplicationAttempt

void submitApplicationAttempt(FiCaSchedulerApp application,
                              String userName)
Submit an application attempt to the queue.


finishApplication

void finishApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
                       String user)
An application submitted to this queue has finished.

Parameters:
applicationId -
user - user who submitted the application

finishApplicationAttempt

void finishApplicationAttempt(FiCaSchedulerApp application,
                              String queue)
An application attempt submitted to this queue has finished.


assignContainers

CSAssignment assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                              FiCaSchedulerNode node,
                              boolean needToUnreserve)
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
needToUnreserve - assign container only if it can unreserve one first
Returns:
the assignment

completedContainer

void completedContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                        FiCaSchedulerApp application,
                        FiCaSchedulerNode node,
                        RMContainer container,
                        org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus,
                        RMContainerEventType event,
                        CSQueue childQueue,
                        boolean sortQueues)
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
childQueue - CSQueue to reinsert in childQueues
event - event to be sent to the container
sortQueues - indicates whether it should re-sort the queues

getNumApplications

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

Returns:
number of applications

reinitialize

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

Parameters:
newlyParsedQueue - 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.

Specified by:
getActiveUsersManager in interface Queue
Returns:
the ActiveUsersManager for the queue

collectSchedulerApplications

void collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps)
Adds all applications in the queue and its subqueues to the given collection.

Parameters:
apps - the collection to add the applications to

detachContainer

void detachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                     FiCaSchedulerApp application,
                     RMContainer container)
Detach a container from this queue

Parameters:
clusterResource - the current cluster resource
application - application to which the container was assigned
container - the container to detach

attachContainer

void attachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                     FiCaSchedulerApp application,
                     RMContainer container)
Attach a container to this queue

Parameters:
clusterResource - the current cluster resource
application - application to which the container was assigned
container - the container to attach

getAbsoluteCapacityByNodeLabel

float getAbsoluteCapacityByNodeLabel(String nodeLabel)
Get absolute capacity by label of this queue can use

Parameters:
nodeLabel -
Returns:
absolute capacity by label of this queue can use

getAbsoluteMaximumCapacityByNodeLabel

float getAbsoluteMaximumCapacityByNodeLabel(String nodeLabel)
Get absolute max capacity by label of this queue can use

Parameters:
nodeLabel -
Returns:
absolute capacity by label of this queue can use

getCapacityByNodeLabel

float getCapacityByNodeLabel(String nodeLabel)
Get capacity by node label

Parameters:
nodeLabel -
Returns:
capacity by node label


Copyright © 2014 Apache Software Foundation. All Rights Reserved.