org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity
Class AbstractCSQueue

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.AbstractCSQueue
All Implemented Interfaces:
CSQueue, Queue
Direct Known Subclasses:
LeafQueue, ParentQueue

public abstract class AbstractCSQueue
extends Object
implements CSQueue


Constructor Summary
AbstractCSQueue(CapacitySchedulerContext cs, String queueName, CSQueue parent, CSQueue old)
           
 
Method Summary
 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 label)
          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 label)
          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.
 Set<String> getAccessibleNodeLabels()
          Get labels can be accessed of this queue labels={*}, means this queue can access any label labels={ }, means this queue cannot access any label except node without label labels={a, b, c} means this queue can access a or b or c
 Map<org.apache.hadoop.yarn.api.records.QueueACL,org.apache.hadoop.security.authorize.AccessControlList> getACLs()
           
 float getCapacity()
          Get the configured capacity of the queue.
 float getCapacityByNodeLabel(String label)
          Get capacity by node label
 String getDefaultNodeLabelExpression()
          Get default label expression of this queue.
 org.apache.hadoop.yarn.api.records.Resource getMaximumAllocation()
           
 float getMaximumCapacity()
          Get the configured maximum-capacity of the queue.
 QueueMetrics getMetrics()
          Get the queue metrics
 org.apache.hadoop.yarn.api.records.Resource getMinimumAllocation()
           
 int getNumContainers()
           
 CSQueue getParent()
          Get the parent Queue.
 String getQueueName()
          Get the queue name.
 boolean getReservationContinueLooking()
           
 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
protected  void releaseResource(org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource resource, Set<String> nodeLabels)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CSQueue
assignContainers, attachContainer, collectSchedulerApplications, completedContainer, detachContainer, finishApplication, finishApplicationAttempt, getActiveUsersManager, getChildQueues, getNumApplications, getQueuePath, reinitialize, submitApplication, submitApplicationAttempt, updateClusterResource
 
Methods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.scheduler.Queue
getQueueInfo, getQueueUserAclInfo, recoverContainer
 

Constructor Detail

AbstractCSQueue

public AbstractCSQueue(CapacitySchedulerContext cs,
                       String queueName,
                       CSQueue parent,
                       CSQueue old)
                throws IOException
Throws:
IOException
Method Detail

getCapacity

public float getCapacity()
Description copied from interface: CSQueue
Get the configured capacity of the queue.

Specified by:
getCapacity in interface CSQueue
Returns:
configured queue capacity

getAbsoluteCapacity

public float getAbsoluteCapacity()
Description copied from interface: CSQueue
Get capacity of the parent of the queue as a function of the cumulative capacity in the cluster.

Specified by:
getAbsoluteCapacity in interface CSQueue
Returns:
capacity of the parent of the queue as a function of the cumulative capacity in the cluster

getAbsoluteMaximumCapacity

public float getAbsoluteMaximumCapacity()
Description copied from interface: CSQueue
Get maximum-capacity of the queue as a funciton of the cumulative capacity of the cluster.

Specified by:
getAbsoluteMaximumCapacity in interface CSQueue
Returns:
maximum-capacity of the queue as a funciton of the cumulative capacity of the cluster

getAbsoluteUsedCapacity

public float getAbsoluteUsedCapacity()
Description copied from interface: CSQueue
Get the current absolute used capacity of the queue relative to the entire cluster.

Specified by:
getAbsoluteUsedCapacity in interface CSQueue
Returns:
queue absolute used capacity

getMaximumCapacity

public float getMaximumCapacity()
Description copied from interface: CSQueue
Get the configured maximum-capacity of the queue.

Specified by:
getMaximumCapacity in interface CSQueue
Returns:
the configured maximum-capacity of the queue

getUsedCapacity

public float getUsedCapacity()
Description copied from interface: CSQueue
Get the current used capacity of nodes without label(s) of the queue and it's children (if any).

Specified by:
getUsedCapacity in interface CSQueue
Returns:
queue used capacity

getUsedResources

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

Specified by:
getUsedResources in interface CSQueue
Returns:
used resources by the queue and it's children

getNumContainers

public int getNumContainers()

getState

public org.apache.hadoop.yarn.api.records.QueueState getState()
Description copied from interface: CSQueue
Get the current run-state of the queue

Specified by:
getState in interface CSQueue
Returns:
current run-state

getMetrics

public QueueMetrics getMetrics()
Description copied from interface: Queue
Get the queue metrics

Specified by:
getMetrics in interface Queue
Returns:
the queue metrics

getQueueName

public String getQueueName()
Description copied from interface: CSQueue
Get the queue name.

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

getParent

public CSQueue getParent()
Description copied from interface: CSQueue
Get the parent Queue.

Specified by:
getParent in interface CSQueue
Returns:
the parent queue

setParent

public void setParent(CSQueue newParentQueue)
Description copied from interface: CSQueue
Set the parent Queue.

Specified by:
setParent in interface CSQueue
Parameters:
newParentQueue - new parent queue

getAccessibleNodeLabels

public Set<String> getAccessibleNodeLabels()
Description copied from interface: Queue
Get labels can be accessed of this queue labels={*}, means this queue can access any label labels={ }, means this queue cannot access any label except node without label labels={a, b, c} means this queue can access a or b or c

Specified by:
getAccessibleNodeLabels in interface Queue
Returns:
labels

hasAccess

public boolean hasAccess(org.apache.hadoop.yarn.api.records.QueueACL acl,
                         org.apache.hadoop.security.UserGroupInformation user)
Description copied from interface: CSQueue
Check if the user has permission to perform the operation

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

setUsedCapacity

public void setUsedCapacity(float usedCapacity)
Description copied from interface: CSQueue
Set used capacity of the queue.

Specified by:
setUsedCapacity in interface CSQueue
Parameters:
usedCapacity - used capacity of the queue

setAbsoluteUsedCapacity

public void setAbsoluteUsedCapacity(float absUsedCapacity)
Description copied from interface: CSQueue
Set absolute used capacity of the queue.

Specified by:
setAbsoluteUsedCapacity in interface CSQueue
Parameters:
absUsedCapacity - absolute used capacity of the queue

getAbsActualCapacity

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

Specified by:
getAbsActualCapacity in interface CSQueue
Returns:
actual queue capacity

getDefaultNodeLabelExpression

public String getDefaultNodeLabelExpression()
Description copied from interface: Queue
Get default label expression of this queue. If label expression of ApplicationSubmissionContext and label expression of Resource Request not set, this will be used.

Specified by:
getDefaultNodeLabelExpression in interface Queue
Returns:
default label expression

getMaximumAllocation

@InterfaceAudience.Private
public org.apache.hadoop.yarn.api.records.Resource getMaximumAllocation()

getMinimumAllocation

@InterfaceAudience.Private
public org.apache.hadoop.yarn.api.records.Resource getMinimumAllocation()

releaseResource

protected void releaseResource(org.apache.hadoop.yarn.api.records.Resource clusterResource,
                               org.apache.hadoop.yarn.api.records.Resource resource,
                               Set<String> nodeLabels)

getCapacityByNodeLabel

@InterfaceAudience.Private
public float getCapacityByNodeLabel(String label)
Description copied from interface: CSQueue
Get capacity by node label

Specified by:
getCapacityByNodeLabel in interface CSQueue
Returns:
capacity by node label

getAbsoluteCapacityByNodeLabel

@InterfaceAudience.Private
public float getAbsoluteCapacityByNodeLabel(String label)
Description copied from interface: CSQueue
Get absolute capacity by label of this queue can use

Specified by:
getAbsoluteCapacityByNodeLabel in interface CSQueue
Returns:
absolute capacity by label of this queue can use

getAbsoluteMaximumCapacityByNodeLabel

@InterfaceAudience.Private
public float getAbsoluteMaximumCapacityByNodeLabel(String label)
Description copied from interface: CSQueue
Get absolute max capacity by label of this queue can use

Specified by:
getAbsoluteMaximumCapacityByNodeLabel in interface CSQueue
Returns:
absolute capacity by label of this queue can use

getReservationContinueLooking

@InterfaceAudience.Private
public boolean getReservationContinueLooking()

getACLs

@InterfaceAudience.Private
public Map<org.apache.hadoop.yarn.api.records.QueueACL,org.apache.hadoop.security.authorize.AccessControlList> getACLs()


Copyright © 2014 Apache Software Foundation. All Rights Reserved.