@Override public String getQueuePath() { return getParent().getQueuePath() + "." + getQueueName(); }
@Override public String getQueuePath() { return getParent().getQueuePath() + "." + getQueueName(); }
@Override public synchronized List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user) { QueueUserACLInfo userAclInfo = recordFactory.newRecordInstance(QueueUserACLInfo.class); List<QueueACL> operations = new ArrayList<QueueACL>(); for (QueueACL operation : QueueACL.values()) { if (hasAccess(operation, user)) { operations.add(operation); } } userAclInfo.setQueueName(getQueueName()); userAclInfo.setUserAcls(operations); return Collections.singletonList(userAclInfo); }
@Override public synchronized List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user) { QueueUserACLInfo userAclInfo = recordFactory.newRecordInstance(QueueUserACLInfo.class); List<QueueACL> operations = new ArrayList<QueueACL>(); for (QueueACL operation : QueueACL.values()) { if (hasAccess(operation, user)) { operations.add(operation); } } userAclInfo.setQueueName(getQueueName()); userAclInfo.setUserAcls(operations); return Collections.singletonList(userAclInfo); }
@Override public List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user) { try { readLock.lock(); QueueUserACLInfo userAclInfo = recordFactory.newRecordInstance( QueueUserACLInfo.class); List<QueueACL> operations = new ArrayList<>(); for (QueueACL operation : QueueACL.values()) { if (hasAccess(operation, user)) { operations.add(operation); } } userAclInfo.setQueueName(getQueueName()); userAclInfo.setUserAcls(operations); return Collections.singletonList(userAclInfo); } finally { readLock.unlock(); } }
@VisibleForTesting /** * Set the acls for the queues. * @param authorizer the yarnAuthorizationProvider * @param queues the queues * @throws IOException if fails to set queue acls */ public static void setQueueAcls(YarnAuthorizationProvider authorizer, AppPriorityACLsManager appPriorityACLManager, Map<String, CSQueue> queues) throws IOException { List<Permission> permissions = new ArrayList<>(); for (CSQueue queue : queues.values()) { AbstractCSQueue csQueue = (AbstractCSQueue) queue; permissions.add( new Permission(csQueue.getPrivilegedEntity(), csQueue.getACLs())); if (queue instanceof LeafQueue) { LeafQueue lQueue = (LeafQueue) queue; // Clear Priority ACLs first since reinitialize also call same. appPriorityACLManager.clearPriorityACLs(lQueue.getQueueName()); appPriorityACLManager.addPrioirityACLs(lQueue.getPriorityACLs(), lQueue.getQueueName()); } } authorizer.setPermission(permissions, UserGroupInformation.getCurrentUser()); }
getQueueName() + " used=" + queueUsage.getUsed() + " numContainers=" + numContainers + " user=" + userName + " user-resources=" + user.getUsed());
"Specified queue=" + dest.getQueueName() + " can't satisfy following " + "apps label expressions =" + nonAccessiblelabels + " accessible node labels =" + targetqueuelabels);
private synchronized void addApplicationAttempt(FiCaSchedulerApp application, User user) { // Accept user.submitApplication(); pendingApplications.add(application); applicationAttemptMap.put(application.getApplicationAttemptId(), application); // Activate applications activateApplications(); LOG.info("Application added -" + " appId: " + application.getApplicationId() + " user: " + user + "," + " leaf-queue: " + getQueueName() + " #user-pending-applications: " + user.getPendingApplications() + " #user-active-applications: " + user.getActiveApplications() + " #queue-pending-applications: " + getNumPendingApplications() + " #queue-active-applications: " + getNumActiveApplications() ); }
private synchronized void addApplicationAttempt(FiCaSchedulerApp application, User user) { // Accept user.submitApplication(); pendingApplications.add(application); applicationAttemptMap.put(application.getApplicationAttemptId(), application); // Activate applications activateApplications(); LOG.info("Application added -" + " appId: " + application.getApplicationId() + " user: " + user + "," + " leaf-queue: " + getQueueName() + " #user-pending-applications: " + user.getPendingApplications() + " #user-active-applications: " + user.getActiveApplications() + " #queue-pending-applications: " + getNumPendingApplications() + " #queue-active-applications: " + getNumActiveApplications() ); }
private void markContainerForNonKillable( RMContainer nonKillableContainer) { try { writeLock.lock(); if (LOG.isDebugEnabled()) { LOG.debug( SchedulerEventType.MARK_CONTAINER_FOR_NONKILLABLE + ": container" + nonKillableContainer.toString()); } FiCaSchedulerNode node = (FiCaSchedulerNode) getSchedulerNode( nonKillableContainer.getAllocatedNode()); FiCaSchedulerApp application = getCurrentAttemptForContainer( nonKillableContainer.getContainerId()); node.markContainerToNonKillable(nonKillableContainer.getContainerId()); // notify PreemptionManager // Get the application for the finished container if (null != application) { String leafQueueName = application.getCSLeafQueue().getQueueName(); getPreemptionManager().removeKillableContainer( new KillableContainer(nonKillableContainer, node.getPartition(), leafQueueName)); } } finally { writeLock.unlock(); } }
synchronized void releaseResource(Resource clusterResource, FiCaSchedulerApp application, Resource resource, Set<String> nodeLabels) { super.releaseResource(clusterResource, resource, nodeLabels); // Update user metrics String userName = application.getUser(); User user = getUser(userName); user.releaseContainer(resource, nodeLabels); metrics.setAvailableResourcesToUser(userName, application.getHeadroom()); LOG.info(getQueueName() + " used=" + queueUsage.getUsed() + " numContainers=" + numContainers + " user=" + userName + " user-resources=" + user.getUsed()); }
synchronized void releaseResource(Resource clusterResource, FiCaSchedulerApp application, Resource resource, Set<String> nodeLabels) { super.releaseResource(clusterResource, resource, nodeLabels); // Update user metrics String userName = application.getUser(); User user = getUser(userName); user.releaseContainer(resource, nodeLabels); metrics.setAvailableResourcesToUser(userName, application.getHeadroom()); LOG.info(getQueueName() + " used=" + queueUsage.getUsed() + " numContainers=" + numContainers + " user=" + userName + " user-resources=" + user.getUsed()); }
String leafQueueName = application.getCSLeafQueue().getQueueName(); getPreemptionManager().addKillableContainer( new KillableContainer(killableContainer, node.getPartition(),
public synchronized void removeApplicationAttempt( FiCaSchedulerApp application, User user) { boolean wasActive = activeApplications.remove(application); if (!wasActive) { pendingApplications.remove(application); } else { queueUsage.decAMUsed(application.getAMResource()); user.getResourceUsage().decAMUsed(application.getAMResource()); } applicationAttemptMap.remove(application.getApplicationAttemptId()); user.finishApplication(wasActive); if (user.getTotalApplications() == 0) { users.remove(application.getUser()); } // Check if we can activate more applications activateApplications(); LOG.info("Application removed -" + " appId: " + application.getApplicationId() + " user: " + application.getUser() + " queue: " + getQueueName() + " #user-pending-applications: " + user.getPendingApplications() + " #user-active-applications: " + user.getActiveApplications() + " #queue-pending-applications: " + getNumPendingApplications() + " #queue-active-applications: " + getNumActiveApplications() ); }
public synchronized void removeApplicationAttempt( FiCaSchedulerApp application, User user) { boolean wasActive = activeApplications.remove(application); if (!wasActive) { pendingApplications.remove(application); } else { queueUsage.decAMUsed(application.getAMResource()); user.getResourceUsage().decAMUsed(application.getAMResource()); } applicationAttemptMap.remove(application.getApplicationAttemptId()); user.finishApplication(wasActive); if (user.getTotalApplications() == 0) { users.remove(application.getUser()); } // Check if we can activate more applications activateApplications(); LOG.info("Application removed -" + " appId: " + application.getApplicationId() + " user: " + application.getUser() + " queue: " + getQueueName() + " #user-pending-applications: " + user.getPendingApplications() + " #user-active-applications: " + user.getActiveApplications() + " #queue-pending-applications: " + getNumPendingApplications() + " #queue-active-applications: " + getNumActiveApplications() ); }
synchronized void allocateResource(Resource clusterResource, SchedulerApplicationAttempt application, Resource resource, Set<String> nodeLabels) { super.allocateResource(clusterResource, resource, nodeLabels); // Update user metrics String userName = application.getUser(); User user = getUser(userName); user.assignContainer(resource, nodeLabels); // Note this is a bit unconventional since it gets the object and modifies // it here, rather then using set routine Resources.subtractFrom(application.getHeadroom(), resource); // headroom metrics.setAvailableResourcesToUser(userName, application.getHeadroom()); if (LOG.isDebugEnabled()) { LOG.info(getQueueName() + " user=" + userName + " used=" + queueUsage.getUsed() + " numContainers=" + numContainers + " headroom = " + application.getHeadroom() + " user-resources=" + user.getUsed() ); } }
synchronized void allocateResource(Resource clusterResource, SchedulerApplicationAttempt application, Resource resource, Set<String> nodeLabels) { super.allocateResource(clusterResource, resource, nodeLabels); // Update user metrics String userName = application.getUser(); User user = getUser(userName); user.assignContainer(resource, nodeLabels); // Note this is a bit unconventional since it gets the object and modifies // it here, rather then using set routine Resources.subtractFrom(application.getHeadroom(), resource); // headroom metrics.setAvailableResourcesToUser(userName, application.getHeadroom()); if (LOG.isDebugEnabled()) { LOG.info(getQueueName() + " user=" + userName + " used=" + queueUsage.getUsed() + " numContainers=" + numContainers + " headroom = " + application.getHeadroom() + " user-resources=" + user.getUsed() ); } }
"Application added -" + " appId: " + application.getApplicationId() + " user: " + application.getUser() + "," + " leaf-queue: " + getQueueName() + " #user-pending-applications: " + user .getPendingApplications() + " #user-active-applications: " + user .getActiveApplications() + " #queue-pending-applications: "
null, false); LOG.info("Killed container=" + toKillContainer.getContainerId() + " from queue=" + lq.getQueueName() + " to make queue=" + this .getQueueName() + "'s max-capacity enforced");