public class MaxRunningAppsEnforcer extends Object
Constructor and Description |
---|
MaxRunningAppsEnforcer(FairScheduler scheduler) |
Modifier and Type | Method and Description |
---|---|
boolean |
canAppBeRunnable(FSQueue queue,
FSAppAttempt attempt)
Checks whether making the application runnable would exceed any
maxRunningApps limits.
|
boolean |
exceedQueueMaxRunningApps(FSQueue queue)
Recursively checks whether the number of queue runnable apps exceeds the
limitation.
|
boolean |
exceedUserMaxApps(String user)
Checks whether the number of user runnable apps exceeds the limitation.
|
void |
trackNonRunnableApp(FSAppAttempt app)
Tracks the given new non runnable app so that it can be made runnable when
it would not violate max running app limits.
|
void |
trackRunnableApp(FSAppAttempt app)
Tracks the given new runnable app for purposes of maintaining max running
app limits.
|
void |
untrackNonRunnableApp(FSAppAttempt app)
Stops tracking the given non-runnable app
|
void |
untrackRunnableApp(FSAppAttempt app)
Updates the relevant tracking variables after a runnable app with the given
queue and user has been removed.
|
void |
updateRunnabilityOnAppRemoval(FSAppAttempt app,
FSLeafQueue queue)
Checks to see whether any other applications runnable now that the given
application has been removed from the given queue.
|
void |
updateRunnabilityOnReload()
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 MaxRunningAppsEnforcer(FairScheduler scheduler)
public boolean canAppBeRunnable(FSQueue queue, FSAppAttempt attempt)
queue
- the current queueattempt
- the app attempt being checkedpublic boolean exceedUserMaxApps(String user)
user
- the user namepublic boolean exceedQueueMaxRunningApps(FSQueue queue)
queue
- the current queuepublic void trackRunnableApp(FSAppAttempt app)
public void trackNonRunnableApp(FSAppAttempt app)
public void updateRunnabilityOnReload()
public void updateRunnabilityOnAppRemoval(FSAppAttempt app, FSLeafQueue queue)
public void untrackRunnableApp(FSAppAttempt app)
public void untrackNonRunnableApp(FSAppAttempt app)
Copyright © 2008–2021 Apache Software Foundation. All rights reserved.