@InterfaceAudience.Private @InterfaceStability.Unstable public class LeafQueue extends AbstractCSQueue
Modifier and Type | Class and Description |
---|---|
static class |
LeafQueue.User |
Queue.QueueLabelPolicy
Modifier and Type | Field and Description |
---|---|
protected int |
maxApplications |
protected int |
maxApplicationsPerUser |
authorizer, csContext, queueEntity
LABEL_NONE
Constructor and Description |
---|
LeafQueue(CapacitySchedulerContext cs,
String queueName,
CSQueue parent,
CSQueue old) |
Modifier and Type | Method and Description |
---|---|
CSAssignment |
assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource,
FiCaSchedulerNode node,
boolean needToUnreserve,
ResourceLimits currentResourceLimits)
Assign containers to applications in the queue or it's children (if any).
|
protected boolean |
assignToUser(org.apache.hadoop.yarn.api.records.Resource clusterResource,
String userName,
org.apache.hadoop.yarn.api.records.Resource limit,
FiCaSchedulerApp application,
boolean checkReservations,
Set<String> requestLabels) |
void |
attachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource,
FiCaSchedulerApp application,
RMContainer rmContainer)
Attach a container to this queue
|
protected boolean |
checkLimitsToReserve(org.apache.hadoop.yarn.api.records.Resource clusterResource,
FiCaSchedulerApp application,
org.apache.hadoop.yarn.api.records.Resource capability,
boolean needToUnreserve) |
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 rmContainer,
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 rmContainer)
Detach a container from this queue
|
protected boolean |
findNodeToUnreserve(org.apache.hadoop.yarn.api.records.Resource clusterResource,
FiCaSchedulerNode node,
FiCaSchedulerApp application,
org.apache.hadoop.yarn.api.records.Priority priority,
org.apache.hadoop.yarn.api.records.Resource capability) |
void |
finishApplication(org.apache.hadoop.yarn.api.records.ApplicationId application,
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.
|
ActiveUsersManager |
getActiveUsersManager()
Get the
ActiveUsersManager for the queue. |
org.apache.hadoop.yarn.api.records.Resource |
getAMResourceLimit() |
Set<FiCaSchedulerApp> |
getApplications()
Obtain (read-only) collection of active applications.
|
List<CSQueue> |
getChildQueues()
Get child queues
|
protected org.apache.hadoop.yarn.api.records.Resource |
getHeadroom(LeafQueue.User user,
org.apache.hadoop.yarn.api.records.Resource queueCurrentLimit,
org.apache.hadoop.yarn.api.records.Resource clusterResource,
FiCaSchedulerApp application,
org.apache.hadoop.yarn.api.records.Resource required) |
net.java.dev.eval.Expression |
getLabel() |
Queue.QueueLabelPolicy |
getLabelPolicy() |
float |
getMaxAMResourcePerQueuePercent()
Used only by tests.
|
int |
getMaxApplications() |
int |
getMaxApplicationsPerUser() |
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) |
org.apache.hadoop.yarn.api.records.QueueInfo |
getQueueInfo(boolean includeChildQueues,
boolean recursive)
Get queue information
|
String |
getQueuePath()
Get the full name of the queue, including the heirarchy.
|
List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> |
getQueueUserAclInfo(org.apache.hadoop.security.UserGroupInformation user)
Get queue ACLs for given
user . |
org.apache.hadoop.yarn.api.records.QueueState |
getState()
Get the current run-state of the queue
|
org.apache.hadoop.yarn.api.records.Resource |
getTotalResourcePending() |
LeafQueue.User |
getUser(String userName) |
org.apache.hadoop.yarn.api.records.Resource |
getUserAMResourceLimit() |
int |
getUserLimit() |
float |
getUserLimitFactor() |
ArrayList<UserInfo> |
getUsers() |
void |
recoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource,
SchedulerApplicationAttempt attempt,
RMContainer rmContainer)
Recover the state of the queue for a given container.
|
void |
reinitialize(CSQueue newlyParsedQueue,
org.apache.hadoop.yarn.api.records.Resource clusterResource)
Reinitialize the queue.
|
void |
removeApplicationAttempt(FiCaSchedulerApp application,
LeafQueue.User user) |
void |
setAbsoluteCapacity(float absoluteCapacity) |
void |
setCapacity(float capacity) |
void |
setMaxApplications(int maxApplications) |
void |
setNodeLabelManager(RMNodeLabelsManager mgr) |
protected void |
setupQueueConfigs(org.apache.hadoop.yarn.api.records.Resource clusterResource) |
void |
submitApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId,
String userName,
String queue)
Submit a new application to the queue.
|
void |
submitApplicationAttempt(FiCaSchedulerApp application,
String userName)
Submit an application attempt to the queue.
|
String |
toString() |
void |
updateClusterResource(org.apache.hadoop.yarn.api.records.Resource clusterResource,
ResourceLimits currentResourceLimits)
Update the cluster resource for queues as we add/remove nodes
|
getAbsoluteCapacity, getAbsoluteMaximumCapacity, getAbsoluteUsedCapacity, getAccessibleNodeLabels, getACLs, getCapacity, getCurrentResourceLimit, getDefaultNodeLabelExpression, getMaximumAllocation, getMaximumCapacity, getMetrics, getMinimumAllocation, getParent, getPreemptionDisabled, getPrivilegedEntity, getQueueCapacities, getQueueInfo, getQueueName, getQueueResourceUsage, getReservationContinueLooking, getUsedCapacity, getUsedResources, hasAccess, releaseResource, setAbsoluteUsedCapacity, setParent, setupConfigurableCapacities, setUsedCapacity
protected int maxApplications
protected int maxApplicationsPerUser
public LeafQueue(CapacitySchedulerContext cs, String queueName, CSQueue parent, CSQueue old) throws IOException
IOException
protected void setupQueueConfigs(org.apache.hadoop.yarn.api.records.Resource clusterResource) throws IOException
IOException
public String getQueuePath()
CSQueue
@InterfaceAudience.Private public float getMinimumAllocationFactor()
@InterfaceAudience.Private public float getMaxAMResourcePerQueuePercent()
public int getMaxApplications()
public int getMaxApplicationsPerUser()
public ActiveUsersManager getActiveUsersManager()
CSQueue
ActiveUsersManager
for the queue.ActiveUsersManager
for the queuepublic List<CSQueue> getChildQueues()
CSQueue
public int getNumApplications()
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()
getNumContainers
in class AbstractCSQueue
public org.apache.hadoop.yarn.api.records.QueueState getState()
CSQueue
getState
in interface CSQueue
getState
in class AbstractCSQueue
@InterfaceAudience.Private public int getUserLimit()
@InterfaceAudience.Private public float getUserLimitFactor()
public org.apache.hadoop.yarn.api.records.QueueInfo getQueueInfo(boolean includeChildQueues, boolean recursive)
Queue
includeChildQueues
- include child queues?recursive
- recursively get child queue information?public List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo(org.apache.hadoop.security.UserGroupInformation user)
Queue
user
.user
- username@InterfaceAudience.Private public int getNodeLocalityDelay()
public void setNodeLabelManager(RMNodeLabelsManager mgr)
public LeafQueue.User getUser(String userName)
public ArrayList<UserInfo> getUsers()
public void reinitialize(CSQueue newlyParsedQueue, org.apache.hadoop.yarn.api.records.Resource clusterResource) throws IOException
CSQueue
newlyParsedQueue
- new queue to re-initalize fromclusterResource
- resources in the clusterIOException
public void submitApplicationAttempt(FiCaSchedulerApp application, String userName)
CSQueue
public void submitApplication(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, String userName, String queue) throws org.apache.hadoop.security.AccessControlException
CSQueue
applicationId
- the applicationId of the application being submitteduserName
- user who submitted the applicationqueue
- queue to which the application is submittedorg.apache.hadoop.security.AccessControlException
public org.apache.hadoop.yarn.api.records.Resource getAMResourceLimit()
public org.apache.hadoop.yarn.api.records.Resource getUserAMResourceLimit()
public void finishApplication(org.apache.hadoop.yarn.api.records.ApplicationId application, String user)
CSQueue
user
- user who submitted the applicationpublic void finishApplicationAttempt(FiCaSchedulerApp application, String queue)
CSQueue
public void removeApplicationAttempt(FiCaSchedulerApp application, LeafQueue.User user)
public CSAssignment assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerNode node, boolean needToUnreserve, ResourceLimits currentResourceLimits)
CSQueue
clusterResource
- the resource of the cluster.node
- node on which resources are availableneedToUnreserve
- assign container only if it can unreserve one firstcurrentResourceLimits
- how much overall resource of this queue can use.protected org.apache.hadoop.yarn.api.records.Resource getHeadroom(LeafQueue.User user, org.apache.hadoop.yarn.api.records.Resource queueCurrentLimit, org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, org.apache.hadoop.yarn.api.records.Resource required)
@InterfaceAudience.Private protected boolean assignToUser(org.apache.hadoop.yarn.api.records.Resource clusterResource, String userName, org.apache.hadoop.yarn.api.records.Resource limit, FiCaSchedulerApp application, boolean checkReservations, Set<String> requestLabels)
@InterfaceAudience.Private protected boolean findNodeToUnreserve(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerNode node, FiCaSchedulerApp application, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.Resource capability)
@InterfaceAudience.Private protected boolean checkLimitsToReserve(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, org.apache.hadoop.yarn.api.records.Resource capability, boolean needToUnreserve)
public void completedContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue, boolean sortQueues)
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 childQueuessortQueues
- indicates whether it should re-sort the queuespublic void updateClusterResource(org.apache.hadoop.yarn.api.records.Resource clusterResource, ResourceLimits currentResourceLimits)
CSQueue
clusterResource
- the current cluster resourcecurrentResourceLimits
- the current ResourceLimitspublic void recoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, SchedulerApplicationAttempt attempt, RMContainer rmContainer)
Queue
clusterResource
- the resource of the clusterattempt
- the application for which the container was allocatedrmContainer
- the container that was recovered.public Set<FiCaSchedulerApp> getApplications()
public org.apache.hadoop.yarn.api.records.Resource getTotalResourcePending()
public void collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps)
CSQueue
apps
- the collection to add the applications topublic void attachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, RMContainer rmContainer)
CSQueue
clusterResource
- the current cluster resourceapplication
- application to which the container was assignedrmContainer
- the container to attachpublic void detachContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, FiCaSchedulerApp application, RMContainer rmContainer)
CSQueue
clusterResource
- the current cluster resourceapplication
- application to which the container was assignedrmContainer
- the container to detachpublic void setCapacity(float capacity)
public void setAbsoluteCapacity(float absoluteCapacity)
public void setMaxApplications(int maxApplications)
public Queue.QueueLabelPolicy getLabelPolicy()
public net.java.dev.eval.Expression getLabel()
Copyright © 2019 Apache Software Foundation. All Rights Reserved.