@Test public void testGetAppsInQueue() throws Exception { scheduler.init(conf); scheduler.start(); scheduler.reinitialize(conf, resourceManager.getRMContext()); ApplicationAttemptId appAttId1 = createSchedulingRequest(1024, 1, 1, "queue1.subqueue1", "user1"); ApplicationAttemptId appAttId2 = createSchedulingRequest(1024, 1, 1, "queue1.subqueue2", "user1"); ApplicationAttemptId appAttId3 = createSchedulingRequest(1024, 1, 1, "default", "user1"); List<ApplicationAttemptId> apps = scheduler.getAppsInQueue("queue1.subqueue1"); assertEquals(1, apps.size()); assertEquals(appAttId1, apps.get(0)); apps = scheduler.getAppsInQueue("root.queue1.subqueue1"); assertEquals(1, apps.size()); assertEquals(appAttId1, apps.get(0)); apps = scheduler.getAppsInQueue("user1"); assertEquals(1, apps.size()); assertEquals(appAttId3, apps.get(0)); apps = scheduler.getAppsInQueue("root.user1"); assertEquals(1, apps.size()); assertEquals(appAttId3, apps.get(0)); apps = scheduler.getAppsInQueue("queue1"); Assert.assertEquals(2, apps.size()); Set<ApplicationAttemptId> appAttIds = Sets.newHashSet(apps.get(0), apps.get(1)); assertTrue(appAttIds.contains(appAttId1)); assertTrue(appAttIds.contains(appAttId2)); }
@Override public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null; } List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>(); queue.collectSchedulerApplications(apps); return apps; }
FairScheduler extends
    AbstractYarnScheduler<FSAppAttempt, FSSchedulerNode> { @Override public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null; } List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>(); queue.collectSchedulerApplications(apps); return apps; } }
FairScheduler extends
    AbstractYarnScheduler<FSAppAttempt, FSSchedulerNode> { @Override public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null; } List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>(); queue.collectSchedulerApplications(apps); return apps; } FairScheduler(); }
FairScheduler extends
    AbstractYarnScheduler<FSAppAttempt, FSSchedulerNode> { @Override public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null; } List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>(); queue.collectSchedulerApplications(apps); return apps; } FairScheduler(); FairSchedulerConfiguration getConf(); QueueManager getQueueManager(); synchronized RMContainerTokenSecretManager getContainerTokenSecretManager(); synchronized ResourceWeights getAppWeight(FSAppAttempt app); Resource getIncrementResourceCapability(); double getNodeLocalityThreshold(); double getRackLocalityThreshold(); long getNodeLocalityDelayMs(); long getRackLocalityDelayMs(); boolean isContinuousSchedulingEnabled(); synchronized int getContinuousSchedulingSleepMs(); Clock getClock(); FairSchedulerEventLog getEventLog(); @Override Allocation allocate(ApplicationAttemptId appAttemptId,
      List<ResourceRequest> ask, List<ContainerId> release,
      List<String> blacklistAdditions, List<String> blacklistRemovals); FSAppAttempt getSchedulerApp(ApplicationAttemptId appAttemptId); @Override ResourceCalculator getResourceCalculator(); @Override QueueMetrics getRootQueueMetrics(); @Override void handle(SchedulerEvent event); @Override void recover(RMState state); synchronized void setRMContext(RMContext rmContext); @Override void serviceInit(Configuration conf); @Override void serviceStart(); @Override void serviceStop(); @Override void reinitialize(Configuration conf, RMContext rmContext); @Override QueueInfo getQueueInfo(String queueName, boolean includeChildQueues,
      boolean recursive); @Override List<QueueUserACLInfo> getQueueUserAclInfo(); @Override int getNumClusterNodes(); @Override synchronized boolean checkAccess(UserGroupInformation callerUGI,
      QueueACL acl, String queueName); AllocationConfiguration getAllocationConfiguration(); @Override List<ApplicationAttemptId> getAppsInQueue(String queueName); @Override synchronized String moveApplication(ApplicationId appId,
      String queueName); @Override synchronized void updateNodeResource(RMNode nm, 
      ResourceOption resourceOption); @Override EnumSet<SchedulerResourceTypes> getSchedulingResourceTypes(); @Override Set<String> getPlanQueues(); @Override void setEntitlement(String queueName,
      QueueEntitlement entitlement); @Override void removeQueue(String queueName); }
FairScheduler extends
    AbstractYarnScheduler<FSAppAttempt, FSSchedulerNode> { @Override public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null; } List<ApplicationAttemptId> apps = new ArrayList<ApplicationAttemptId>(); queue.collectSchedulerApplications(apps); return apps; } FairScheduler(); FairSchedulerConfiguration getConf(); QueueManager getQueueManager(); synchronized RMContainerTokenSecretManager getContainerTokenSecretManager(); synchronized ResourceWeights getAppWeight(FSAppAttempt app); Resource getIncrementResourceCapability(); double getNodeLocalityThreshold(); double getRackLocalityThreshold(); long getNodeLocalityDelayMs(); long getRackLocalityDelayMs(); boolean isContinuousSchedulingEnabled(); synchronized int getContinuousSchedulingSleepMs(); Clock getClock(); FairSchedulerEventLog getEventLog(); @Override Allocation allocate(ApplicationAttemptId appAttemptId,
      List<ResourceRequest> ask, List<ContainerId> release,
      List<String> blacklistAdditions, List<String> blacklistRemovals); FSAppAttempt getSchedulerApp(ApplicationAttemptId appAttemptId); @Override ResourceCalculator getResourceCalculator(); @Override QueueMetrics getRootQueueMetrics(); @Override void handle(SchedulerEvent event); @Override void recover(RMState state); synchronized void setRMContext(RMContext rmContext); @Override void serviceInit(Configuration conf); @Override void serviceStart(); @Override void serviceStop(); @Override void reinitialize(Configuration conf, RMContext rmContext); @Override QueueInfo getQueueInfo(String queueName, boolean includeChildQueues,
      boolean recursive); @Override List<QueueUserACLInfo> getQueueUserAclInfo(); @Override int getNumClusterNodes(); @Override synchronized boolean checkAccess(UserGroupInformation callerUGI,
      QueueACL acl, String queueName); AllocationConfiguration getAllocationConfiguration(); @Override List<ApplicationAttemptId> getAppsInQueue(String queueName); @Override synchronized String moveApplication(ApplicationId appId,
      String queueName); @Override synchronized void updateNodeResource(RMNode nm, 
      ResourceOption resourceOption); @Override EnumSet<SchedulerResourceTypes> getSchedulingResourceTypes(); @Override Set<String> getPlanQueues(); @Override void setEntitlement(String queueName,
      QueueEntitlement entitlement); @Override void removeQueue(String queueName); static final Resource CONTAINER_RESERVED; }