/** * Checks whether making the application runnable would exceed any * maxRunningApps limits. * * @param queue the current queue * @param attempt the app attempt being checked * @return true if the application is runnable; false otherwise */ public boolean canAppBeRunnable(FSQueue queue, FSAppAttempt attempt) { boolean ret = true; if (exceedUserMaxApps(attempt.getUser())) { attempt.updateAMContainerDiagnostics(AMState.INACTIVATED, "The user \"" + attempt.getUser() + "\" has reached the maximum limit" + " of runnable applications."); ret = false; } else if (exceedQueueMaxRunningApps(queue)) { attempt.updateAMContainerDiagnostics(AMState.INACTIVATED, "The queue \"" + queue.getName() + "\" has reached the maximum limit" + " of runnable applications."); ret = false; } return ret; }