/** * This is called after reloading the allocation configuration when the * scheduler is reinitilized * * Checks to see whether any non-runnable applications become runnable * now that the max running apps of given queue has been changed * * Runs in O(n) where n is the number of apps that are non-runnable and in * the queues that went from having no slack to having slack. */ public void updateRunnabilityOnReload() { FSParentQueue rootQueue = scheduler.getQueueManager().getRootQueue(); List<List<FSAppAttempt>> appsNowMaybeRunnable = new ArrayList<List<FSAppAttempt>>(); gatherPossiblyRunnableAppLists(rootQueue, appsNowMaybeRunnable); updateAppsRunnability(appsNowMaybeRunnable, Integer.MAX_VALUE); }
/** * This is called after reloading the allocation configuration when the * scheduler is reinitilized * * Checks to see whether any non-runnable applications become runnable * now that the max running apps of given queue has been changed * * Runs in O(n) where n is the number of apps that are non-runnable and in * the queues that went from having no slack to having slack. */ public void updateRunnabilityOnReload() { FSParentQueue rootQueue = scheduler.getQueueManager().getRootQueue(); List<List<FSAppAttempt>> appsNowMaybeRunnable = new ArrayList<List<FSAppAttempt>>(); gatherPossiblyRunnableAppLists(rootQueue, appsNowMaybeRunnable); updateAppsRunnability(appsNowMaybeRunnable, Integer.MAX_VALUE); }
/** * This is called after reloading the allocation configuration when the * scheduler is reinitilized * * Checks to see whether any non-runnable applications become runnable * now that the max running apps of given queue has been changed * * Runs in O(n) where n is the number of apps that are non-runnable and in * the queues that went from having no slack to having slack. */ public void updateRunnabilityOnReload() { FSParentQueue rootQueue = scheduler.getQueueManager().getRootQueue(); List<List<FSAppAttempt>> appsNowMaybeRunnable = new ArrayList<List<FSAppAttempt>>(); gatherPossiblyRunnableAppLists(rootQueue, appsNowMaybeRunnable); updateAppsRunnability(appsNowMaybeRunnable, Integer.MAX_VALUE); }
/** * Traverses the queue hierarchy under the given queue to gather all lists * of non-runnable applications. */ private void gatherPossiblyRunnableAppLists(FSQueue queue, List<List<FSAppAttempt>> appLists) { if (queue.getNumRunnableApps() < queue.getMaxRunningApps()) { if (queue instanceof FSLeafQueue) { appLists.add( ((FSLeafQueue)queue).getCopyOfNonRunnableAppSchedulables()); } else { for (FSQueue child : queue.getChildQueues()) { gatherPossiblyRunnableAppLists(child, appLists); } } } }
/** * Traverses the queue hierarchy under the given queue to gather all lists * of non-runnable applications. */ private void gatherPossiblyRunnableAppLists(FSQueue queue, List<List<FSAppAttempt>> appLists) { if (queue.getNumRunnableApps() < scheduler.getAllocationConfiguration() .getQueueMaxApps(queue.getName())) { if (queue instanceof FSLeafQueue) { appLists.add( ((FSLeafQueue)queue).getCopyOfNonRunnableAppSchedulables()); } else { for (FSQueue child : queue.getChildQueues()) { gatherPossiblyRunnableAppLists(child, appLists); } } } }
/** * Traverses the queue hierarchy under the given queue to gather all lists * of non-runnable applications. */ private void gatherPossiblyRunnableAppLists(FSQueue queue, List<List<FSAppAttempt>> appLists) { if (queue.getNumRunnableApps() < scheduler.getAllocationConfiguration() .getQueueMaxApps(queue.getName())) { if (queue instanceof FSLeafQueue) { appLists.add( ((FSLeafQueue)queue).getCopyOfNonRunnableAppSchedulables()); } else { for (FSQueue child : queue.getChildQueues()) { gatherPossiblyRunnableAppLists(child, appLists); } } } }
gatherPossiblyRunnableAppLists(highestQueueWithAppsNowRunnable, appsNowMaybeRunnable);
gatherPossiblyRunnableAppLists(highestQueueWithAppsNowRunnable, appsNowMaybeRunnable);
gatherPossiblyRunnableAppLists(highestQueueWithAppsNowRunnable, appsNowMaybeRunnable);