@InterfaceAudience.Private @InterfaceStability.Unstable public class LeafQueue extends Object implements CSQueue
Constructor and Description |
---|
LeafQueue(CapacitySchedulerContext cs,
String queueName,
CSQueue parent,
CSQueue old) |
Modifier and Type | Method and Description |
---|---|
CSAssignment |
assignContainers(Resource clusterResource,
FiCaSchedulerNode node)
Assign containers to applications in the queue or it's children (if any).
|
void |
completedContainer(Resource clusterResource,
FiCaSchedulerApp application,
FiCaSchedulerNode node,
RMContainer rmContainer,
ContainerStatus containerStatus,
RMContainerEventType event,
CSQueue childQueue)
A container assigned to the queue has completed.
|
void |
finishApplication(FiCaSchedulerApp 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.
|
float |
getAbsoluteUsedCapacity()
Get the current absolute used capacity of the queue
relative to the entire cluster.
|
ActiveUsersManager |
getActiveUsersManager()
Get the
ActiveUsersManager for the queue. |
Set<FiCaSchedulerApp> |
getApplications()
Obtain (read-only) collection of active applications.
|
float |
getCapacity()
Get the configured capacity of the queue.
|
List<CSQueue> |
getChildQueues()
Get child queues
|
float |
getMaxAMResourcePerQueuePercent()
Used only by tests.
|
int |
getMaxApplications() |
int |
getMaxApplicationsPerUser() |
int |
getMaximumActiveApplications() |
int |
getMaximumActiveApplicationsPerUser() |
Resource |
getMaximumAllocation()
Used only by tests.
|
float |
getMaximumCapacity()
Get the configured maximum-capacity of the queue.
|
QueueMetrics |
getMetrics()
Get the queue metrics
|
Resource |
getMinimumAllocation()
Used only by tests.
|
float |
getMinimumAllocationFactor()
Used only by tests.
|
int |
getNodeLocalityDelay() |
int |
getNumActiveApplications() |
int |
getNumActiveApplications(String user) |
int |
getNumApplications()
Get the number of applications in the queue.
|
int |
getNumApplications(String user) |
int |
getNumContainers() |
int |
getNumPendingApplications() |
int |
getNumPendingApplications(String user) |
CSQueue |
getParent()
Get the parent
Queue . |
Map<QueueACL,AccessControlList> |
getQueueAcls()
Get ACLs for the queue.
|
QueueInfo |
getQueueInfo(boolean includeChildQueues,
boolean recursive)
Get queue information
|
String |
getQueueName()
Get the queue name.
|
String |
getQueuePath()
Get the full name of the queue, including the heirarchy.
|
List<QueueUserACLInfo> |
getQueueUserAclInfo(UserGroupInformation user)
Get queue ACLs for given
user . |
QueueState |
getState()
Get the current run-state of the queue
|
Resource |
getTotalResourcePending() |
float |
getUsedCapacity()
Get the current used capacity of the queue
and it's children (if any).
|
Resource |
getUsedResources()
Get the currently utilized resources in the cluster
by the queue and children (if any).
|
int |
getUserLimit() |
float |
getUserLimitFactor() |
ArrayList<UserInfo> |
getUsers() |
boolean |
hasAccess(QueueACL acl,
UserGroupInformation user)
Check if the
user has permission to perform the operation |
void |
recoverContainer(Resource clusterResource,
FiCaSchedulerApp application,
Container container)
Recover the state of the queue
|
void |
reinitialize(CSQueue newlyParsedQueue,
Resource clusterResource)
Reinitialize the queue.
|
void |
removeApplication(FiCaSchedulerApp application,
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue.User user) |
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(FiCaSchedulerApp application,
String userName,
String queue)
Submit a new application to the queue.
|
String |
toString() |
void |
updateClusterResource(Resource clusterResource)
Update the cluster resource for queues as we add/remove nodes
|
public LeafQueue(CapacitySchedulerContext cs, String queueName, CSQueue parent, CSQueue old)
public float getCapacity()
CSQueue
getCapacity
in interface CSQueue
public float getAbsoluteCapacity()
CSQueue
getAbsoluteCapacity
in interface CSQueue
public float getMaximumCapacity()
CSQueue
getMaximumCapacity
in interface CSQueue
public float getAbsoluteMaximumCapacity()
CSQueue
getAbsoluteMaximumCapacity
in interface CSQueue
public float getAbsoluteUsedCapacity()
CSQueue
getAbsoluteUsedCapacity
in interface CSQueue
public CSQueue getParent()
CSQueue
Queue
.public void setParent(CSQueue newParentQueue)
CSQueue
Queue
.public String getQueueName()
CSQueue
getQueueName
in interface CSQueue
getQueueName
in interface Queue
public String getQueuePath()
CSQueue
getQueuePath
in interface CSQueue
@InterfaceAudience.Private public Resource getMinimumAllocation()
@InterfaceAudience.Private public Resource getMaximumAllocation()
@InterfaceAudience.Private public float getMinimumAllocationFactor()
@InterfaceAudience.Private public float getMaxAMResourcePerQueuePercent()
public int getMaxApplications()
public int getMaxApplicationsPerUser()
public int getMaximumActiveApplications()
public int getMaximumActiveApplicationsPerUser()
public ActiveUsersManager getActiveUsersManager()
CSQueue
ActiveUsersManager
for the queue.getActiveUsersManager
in interface CSQueue
ActiveUsersManager
for the queuepublic float getUsedCapacity()
CSQueue
getUsedCapacity
in interface CSQueue
public Resource getUsedResources()
CSQueue
getUsedResources
in interface CSQueue
public List<CSQueue> getChildQueues()
CSQueue
getChildQueues
in interface CSQueue
public void setUsedCapacity(float usedCapacity)
CSQueue
setUsedCapacity
in interface CSQueue
usedCapacity
- used capacity of the queuepublic void setAbsoluteUsedCapacity(float absUsedCapacity)
CSQueue
setAbsoluteUsedCapacity
in interface CSQueue
absUsedCapacity
- absolute used capacity of the queuepublic int getNumApplications()
CSQueue
getNumApplications
in interface CSQueue
public int getNumPendingApplications()
public int getNumActiveApplications()
@InterfaceAudience.Private public int getNumApplications(String user)
@InterfaceAudience.Private public int getNumPendingApplications(String user)
@InterfaceAudience.Private public int getNumActiveApplications(String user)
public int getNumContainers()
public QueueState getState()
CSQueue
@InterfaceAudience.Private public int getUserLimit()
@InterfaceAudience.Private public float getUserLimitFactor()
public Map<QueueACL,AccessControlList> getQueueAcls()
Queue
getQueueAcls
in interface Queue
public QueueInfo getQueueInfo(boolean includeChildQueues, boolean recursive)
Queue
getQueueInfo
in interface Queue
includeChildQueues
- include child queues?recursive
- recursively get child queue information?public List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user)
Queue
user
.getQueueUserAclInfo
in interface Queue
user
- username@InterfaceAudience.Private public int getNodeLocalityDelay()
public ArrayList<UserInfo> getUsers()
public void reinitialize(CSQueue newlyParsedQueue, Resource clusterResource) throws IOException
CSQueue
reinitialize
in interface CSQueue
newlyParsedQueue
- new queue to re-initalize fromclusterResource
- resources in the clusterIOException
public boolean hasAccess(QueueACL acl, UserGroupInformation user)
CSQueue
user
has permission to perform the operationpublic void submitApplication(FiCaSchedulerApp application, String userName, String queue) throws AccessControlException
CSQueue
submitApplication
in interface CSQueue
application
- application being submitteduserName
- user who submitted the applicationqueue
- queue to which the application is submittedAccessControlException
public void finishApplication(FiCaSchedulerApp application, String queue)
CSQueue
finishApplication
in interface CSQueue
queue
- application queuepublic void removeApplication(FiCaSchedulerApp application, org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue.User user)
public CSAssignment assignContainers(Resource clusterResource, FiCaSchedulerNode node)
CSQueue
assignContainers
in interface CSQueue
clusterResource
- the resource of the cluster.node
- node on which resources are availablepublic void completedContainer(Resource clusterResource, FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue)
CSQueue
completedContainer
in interface CSQueue
clusterResource
- the resource of the clusterapplication
- application to which the container was assignednode
- node on which the container completedrmContainer
- completed container,
null
if it was just a reservationcontainerStatus
- ContainerStatus
for the completed
containerevent
- event to be sent to the containerchildQueue
- CSQueue
to reinsert in childQueuespublic void updateClusterResource(Resource clusterResource)
CSQueue
updateClusterResource
in interface CSQueue
clusterResource
- the current cluster resourcepublic QueueMetrics getMetrics()
Queue
getMetrics
in interface Queue
public void recoverContainer(Resource clusterResource, FiCaSchedulerApp application, Container container)
CSQueue
recoverContainer
in interface CSQueue
clusterResource
- the resource of the clusterapplication
- the application for which the container was allocatedcontainer
- the container that was recovered.public Set<FiCaSchedulerApp> getApplications()
public Resource getTotalResourcePending()
Copyright © 2013 Apache Software Foundation. All rights reserved.