Class MaxRunningAppsEnforcer
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.MaxRunningAppsEnforcer
Handles tracking and enforcement for user and queue maxRunningApps
constraints
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAppBeRunnable(FSQueue queue, FSAppAttempt attempt) Checks whether making the application runnable would exceed any maxRunningApps limits.booleanexceedQueueMaxRunningApps(FSQueue queue) Recursively checks whether the number of queue runnable apps exceeds the limitation.booleanexceedUserMaxApps(String user) Checks whether the number of user runnable apps exceeds the limitation.voidTracks the given new non runnable app so that it can be made runnable when it would not violate max running app limits.voidTracks the given new runnable app for purposes of maintaining max running app limits.voidStops tracking the given non-runnable app.voidUpdates the relevant tracking variables after a runnable app with the given queue and user has been removed.voidupdateRunnabilityOnAppRemoval(FSAppAttempt app, FSLeafQueue queue) Checks to see whether any other applications runnable now that the given application has been removed from the given queue.voidThis is called after reloading the allocation configuration when the scheduler is reinitialized 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.
-
Constructor Details
-
MaxRunningAppsEnforcer
-
-
Method Details
-
canAppBeRunnable
Checks whether making the application runnable would exceed any maxRunningApps limits.- Parameters:
queue- the current queueattempt- the app attempt being checked- Returns:
- true if the application is runnable; false otherwise
-
exceedUserMaxApps
Checks whether the number of user runnable apps exceeds the limitation.- Parameters:
user- the user name- Returns:
- true if the number hits the limit; false otherwise
-
exceedQueueMaxRunningApps
Recursively checks whether the number of queue runnable apps exceeds the limitation.- Parameters:
queue- the current queue- Returns:
- true if the number hits the limit; false otherwise
-
trackRunnableApp
Tracks the given new runnable app for purposes of maintaining max running app limits.- Parameters:
app- FSAppAttempt, the given application.
-
trackNonRunnableApp
Tracks the given new non runnable app so that it can be made runnable when it would not violate max running app limits.- Parameters:
app- FSAppAttempt, the given application.
-
updateRunnabilityOnReload
public void updateRunnabilityOnReload()This is called after reloading the allocation configuration when the scheduler is reinitialized 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. -
updateRunnabilityOnAppRemoval
Checks to see whether any other applications runnable now that the given application has been removed from the given queue. And makes them so. Runs in O(n log(n)) where n is the number of queues that are under the highest queue that went from having no slack to having slack.- Parameters:
queue- FSLeafQueue, the given queue.app- FSAppAttempt, the given application.
-
untrackRunnableApp
Updates the relevant tracking variables after a runnable app with the given queue and user has been removed.- Parameters:
app- FSAppAttempt.
-
untrackNonRunnableApp
Stops tracking the given non-runnable app.- Parameters:
app- FSAppAttempt.
-