org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair
Class MaxRunningAppsEnforcer

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.MaxRunningAppsEnforcer

public class MaxRunningAppsEnforcer
extends Object

Handles tracking and enforcement for user and queue maxRunningApps constraints


Constructor Summary
MaxRunningAppsEnforcer(FairScheduler scheduler)
           
 
Method Summary
 boolean canAppBeRunnable(FSQueue queue, String user)
          Checks whether making the application runnable would exceed any maxRunningApps limits.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxRunningAppsEnforcer

public MaxRunningAppsEnforcer(FairScheduler scheduler)
Method Detail

canAppBeRunnable

public boolean canAppBeRunnable(FSQueue queue,
                                String user)
Checks whether making the application runnable would exceed any maxRunningApps limits.


trackRunnableApp

public void trackRunnableApp(FSAppAttempt app)
Tracks the given new runnable app for purposes of maintaining max running app limits.


trackNonRunnableApp

public 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.


updateRunnabilityOnAppRemoval

public 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. 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.


untrackRunnableApp

public void untrackRunnableApp(FSAppAttempt app)
Updates the relevant tracking variables after a runnable app with the given queue and user has been removed.


untrackNonRunnableApp

public void untrackNonRunnableApp(FSAppAttempt app)
Stops tracking the given non-runnable app



Copyright © 2014 Apache Software Foundation. All Rights Reserved.