LeafQueue extends AbstractCSQueue { @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(); } } @SuppressWarnings({ "unchecked", "rawtypes" })  LeafQueue(CapacitySchedulerContext cs,
      String queueName, CSQueue parent, CSQueue old);  LeafQueue(CapacitySchedulerContext cs,
      CapacitySchedulerConfiguration configuration,
      String queueName, CSQueue parent, CSQueue old); @Private float getMinimumAllocationFactor(); @Private float getMaxAMResourcePerQueuePercent(); int getMaxApplications(); int getMaxApplicationsPerUser(); UsersManager getUsersManager(); @Override AbstractUsersManager getAbstractUsersManager(); @Override List<CSQueue> getChildQueues(); @Override int getNumApplications(); int getNumPendingApplications(); int getNumActiveApplications(); @Private int getNumPendingApplications(String user); @Private int getNumActiveApplications(String user); @Private int getUserLimit(); @Private float getUserLimitFactor(); @Override QueueInfo getQueueInfo(
      boolean includeChildQueues, boolean recursive); @Override List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user); String toString(); @VisibleForTesting User getUser(String userName); @Private List<AppPriorityACLGroup> getPriorityACLs(); @Override void reinitialize(
      CSQueue newlyParsedQueue, Resource clusterResource); @Override void submitApplicationAttempt(FiCaSchedulerApp application,
      String userName); @Override void submitApplication(ApplicationId applicationId, String userName,
      String queue); void validateSubmitApplication(ApplicationId applicationId,
      String userName, String queue); Resource getAMResourceLimit(); Resource getAMResourceLimitPerPartition(String nodePartition); @VisibleForTesting Resource calculateAndGetAMResourceLimit(); @VisibleForTesting Resource getUserAMResourceLimit(); Resource getUserAMResourceLimitPerPartition(
      String nodePartition, String userName); Resource calculateAndGetAMResourceLimitPerPartition(
      String nodePartition); @Override void finishApplication(ApplicationId application, String user); @Override void finishApplicationAttempt(FiCaSchedulerApp application, String queue); @Override CSAssignment assignContainers(Resource clusterResource,
      CandidateNodeSet<FiCaSchedulerNode> candidates,
      ResourceLimits currentResourceLimits, SchedulingMode schedulingMode); @Override boolean accept(Resource cluster,
      ResourceCommitRequest<FiCaSchedulerApp, FiCaSchedulerNode> request); void apply(Resource cluster,
      ResourceCommitRequest<FiCaSchedulerApp, FiCaSchedulerNode> request); @Lock(NoLock.class) int getNodeLocalityDelay(); @Lock(NoLock.class) int getRackLocalityAdditionalDelay(); @Lock(NoLock.class) boolean getRackLocalityFullReset(); Resource getResourceLimitForActiveUsers(String userName,
      Resource clusterResource, String nodePartition,
      SchedulingMode schedulingMode); Resource getResourceLimitForAllUsers(String userName,
      Resource clusterResource, String nodePartition,
      SchedulingMode schedulingMode); void recalculateQueueUsageRatio(Resource clusterResource,
      String nodePartition); @Override void completedContainer(Resource clusterResource, 
      FiCaSchedulerApp application, FiCaSchedulerNode node, RMContainer rmContainer, 
      ContainerStatus containerStatus, RMContainerEventType event, CSQueue childQueue,
      boolean sortQueues); @Override void updateClusterResource(Resource clusterResource,
      ResourceLimits currentResourceLimits); @Override void incUsedResource(String nodeLabel, Resource resourceToInc,
      SchedulerApplicationAttempt application); @Override void decUsedResource(String nodeLabel, Resource resourceToDec,
      SchedulerApplicationAttempt application); void incAMUsedResource(String nodeLabel, Resource resourceToInc,
      SchedulerApplicationAttempt application); void decAMUsedResource(String nodeLabel, Resource resourceToDec,
      SchedulerApplicationAttempt application); @Override void recoverContainer(Resource clusterResource,
      SchedulerApplicationAttempt attempt, RMContainer rmContainer); Collection<FiCaSchedulerApp> getPendingApplications(); Collection<FiCaSchedulerApp> getApplications(); Collection<FiCaSchedulerApp> getAllApplications(); Resource getTotalPendingResourcesConsideringUserLimit(
      Resource clusterResources, String partition,
      boolean deductReservedFromPending); @Override void collectSchedulerApplications(
      Collection<ApplicationAttemptId> apps); @Override void attachContainer(Resource clusterResource,
      FiCaSchedulerApp application, RMContainer rmContainer); @Override void detachContainer(Resource clusterResource,
      FiCaSchedulerApp application, RMContainer rmContainer); Map<String, TreeSet<RMContainer>> getIgnoreExclusivityRMContainers(); void setCapacity(float capacity); void setCapacity(String nodeLabel, float capacity); void setAbsoluteCapacity(float absoluteCapacity); void setAbsoluteCapacity(String nodeLabel, float absoluteCapacity); void setMaxApplicationsPerUser(int maxApplicationsPerUser); void setMaxApplications(int maxApplications); void setMaxAMResourcePerQueuePercent(
      float maxAMResourcePerQueuePercent); OrderingPolicy<FiCaSchedulerApp> getOrderingPolicy(); @Override Priority getDefaultApplicationPriority(); void updateApplicationPriority(SchedulerApplication<FiCaSchedulerApp> app,
      Priority newAppPriority); OrderingPolicy<FiCaSchedulerApp> getPendingAppsOrderingPolicy(); @Override void stopQueue(); Set<String> getAllUsers(); long getMaximumApplicationLifetime(); long getDefaultApplicationLifetime();  }
@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)); }