@Test public void testInheritedQueueAcls() throws IOException { UserGroupInformation user = UserGroupInformation.getCurrentUser(); LeafQueue a = stubLeafQueue((LeafQueue)queues.get(A)); LeafQueue b = stubLeafQueue((LeafQueue)queues.get(B)); ParentQueue c = (ParentQueue)queues.get(C); LeafQueue c1 = stubLeafQueue((LeafQueue)queues.get(C1)); assertFalse(root.hasAccess(QueueACL.SUBMIT_APPLICATIONS, user)); assertTrue(a.hasAccess(QueueACL.SUBMIT_APPLICATIONS, user)); assertTrue(b.hasAccess(QueueACL.SUBMIT_APPLICATIONS, user)); assertFalse(c.hasAccess(QueueACL.SUBMIT_APPLICATIONS, user)); assertFalse(c1.hasAccess(QueueACL.SUBMIT_APPLICATIONS, user)); assertTrue(hasQueueACL( a.getQueueUserAclInfo(user), QueueACL.SUBMIT_APPLICATIONS)); assertTrue(hasQueueACL( b.getQueueUserAclInfo(user), QueueACL.SUBMIT_APPLICATIONS)); assertFalse(hasQueueACL( c.getQueueUserAclInfo(user), QueueACL.SUBMIT_APPLICATIONS)); assertFalse(hasQueueACL( c1.getQueueUserAclInfo(user), QueueACL.SUBMIT_APPLICATIONS)); }
@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); }
LeafQueue extends AbstractCSQueue { @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); } }
LeafQueue extends AbstractCSQueue { @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); } LeafQueue(CapacitySchedulerContext cs, 
      String queueName, CSQueue parent, CSQueue old); }
LeafQueue extends AbstractCSQueue { @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); } LeafQueue(CapacitySchedulerContext cs, 
      String queueName, CSQueue parent, CSQueue old); @Override String getQueuePath(); @Private float getMinimumAllocationFactor(); @Private float getMaxAMResourcePerQueuePercent(); int getMaxApplications(); synchronized int getMaxApplicationsPerUser(); @Override ActiveUsersManager getActiveUsersManager(); @Override List<CSQueue> getChildQueues(); @Override synchronized int getNumApplications(); synchronized int getNumPendingApplications(); synchronized int getNumActiveApplications(); @Private synchronized int getNumApplications(String user); @Private synchronized int getNumPendingApplications(String user); @Private synchronized int getNumActiveApplications(String user); synchronized int getNumContainers(); @Override synchronized QueueState getState(); @Private synchronized int getUserLimit(); @Private synchronized float getUserLimitFactor(); @Override synchronized QueueInfo getQueueInfo(
      boolean includeChildQueues, boolean recursive); @Override synchronized List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user); @Private int getNodeLocalityDelay(); String toString(); @VisibleForTesting synchronized void setNodeLabelManager(RMNodeLabelsManager mgr); @VisibleForTesting synchronized User getUser(String userName); synchronized ArrayList<UserInfo> getUsers(); @Override synchronized void reinitialize(
      CSQueue newlyParsedQueue, Resource clusterResource); @Override void submitApplicationAttempt(FiCaSchedulerApp application,
      String userName); @Override void submitApplication(ApplicationId applicationId, String userName,
      String queue); synchronized Resource getAMResourceLimit(); synchronized Resource getUserAMResourceLimit(); synchronized Resource getUserAMResourceLimitPerPartition(
      String nodePartition); synchronized Resource getAMResourceLimitPerPartition(
      String nodePartition); @Override void finishApplication(ApplicationId application, String user); @Override void finishApplicationAttempt(FiCaSchedulerApp application, String queue); synchronized void removeApplicationAttempt(
      FiCaSchedulerApp application, User user); @Override synchronized CSAssignment assignContainers(Resource clusterResource,
      FiCaSchedulerNode node, ResourceLimits currentResourceLimits); @Override void completedContainer(Resource clusterResource, 
      FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
      ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue,
      boolean sortQueues); @Override synchronized void updateClusterResource(Resource clusterResource,
      ResourceLimits currentResourceLimits); @Override void recoverContainer(Resource clusterResource,
      SchedulerApplicationAttempt attempt, RMContainer rmContainer); Set<FiCaSchedulerApp> getApplications(); synchronized Resource getTotalResourcePending(); @Override synchronized void collectSchedulerApplications(
      Collection<ApplicationAttemptId> apps); @Override void attachContainer(Resource clusterResource,
      FiCaSchedulerApp application, RMContainer rmContainer); @Override void detachContainer(Resource clusterResource,
      FiCaSchedulerApp application, RMContainer rmContainer); void setCapacity(float capacity); void setAbsoluteCapacity(float absoluteCapacity); void setMaxApplications(int maxApplications); }
LeafQueue extends AbstractCSQueue { @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); } LeafQueue(CapacitySchedulerContext cs, 
      String queueName, CSQueue parent, CSQueue old); @Override String getQueuePath(); @Private float getMinimumAllocationFactor(); @Private float getMaxAMResourcePerQueuePercent(); int getMaxApplications(); synchronized int getMaxApplicationsPerUser(); @Override ActiveUsersManager getActiveUsersManager(); @Override List<CSQueue> getChildQueues(); @Override synchronized int getNumApplications(); synchronized int getNumPendingApplications(); synchronized int getNumActiveApplications(); @Private synchronized int getNumApplications(String user); @Private synchronized int getNumPendingApplications(String user); @Private synchronized int getNumActiveApplications(String user); synchronized int getNumContainers(); @Override synchronized QueueState getState(); @Private synchronized int getUserLimit(); @Private synchronized float getUserLimitFactor(); @Override synchronized QueueInfo getQueueInfo(
      boolean includeChildQueues, boolean recursive); @Override synchronized List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user); @Private int getNodeLocalityDelay(); String toString(); @VisibleForTesting synchronized void setNodeLabelManager(RMNodeLabelsManager mgr); @VisibleForTesting synchronized User getUser(String userName); synchronized ArrayList<UserInfo> getUsers(); @Override synchronized void reinitialize(
      CSQueue newlyParsedQueue, Resource clusterResource); @Override void submitApplicationAttempt(FiCaSchedulerApp application,
      String userName); @Override void submitApplication(ApplicationId applicationId, String userName,
      String queue); synchronized Resource getAMResourceLimit(); synchronized Resource getUserAMResourceLimit(); synchronized Resource getUserAMResourceLimitPerPartition(
      String nodePartition); synchronized Resource getAMResourceLimitPerPartition(
      String nodePartition); @Override void finishApplication(ApplicationId application, String user); @Override void finishApplicationAttempt(FiCaSchedulerApp application, String queue); synchronized void removeApplicationAttempt(
      FiCaSchedulerApp application, User user); @Override synchronized CSAssignment assignContainers(Resource clusterResource,
      FiCaSchedulerNode node, ResourceLimits currentResourceLimits); @Override void completedContainer(Resource clusterResource, 
      FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
      ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue,
      boolean sortQueues); @Override synchronized void updateClusterResource(Resource clusterResource,
      ResourceLimits currentResourceLimits); @Override void recoverContainer(Resource clusterResource,
      SchedulerApplicationAttempt attempt, RMContainer rmContainer); Set<FiCaSchedulerApp> getApplications(); synchronized Resource getTotalResourcePending(); @Override synchronized void collectSchedulerApplications(
      Collection<ApplicationAttemptId> apps); @Override void attachContainer(Resource clusterResource,
      FiCaSchedulerApp application, RMContainer rmContainer); @Override void detachContainer(Resource clusterResource,
      FiCaSchedulerApp application, RMContainer rmContainer); void setCapacity(float capacity); void setAbsoluteCapacity(float absoluteCapacity); void setMaxApplications(int maxApplications);  }