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

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.QueuePlacementRule
Direct Known Subclasses:
QueuePlacementRule.Default, QueuePlacementRule.NestedUserQueue, QueuePlacementRule.PrimaryGroup, QueuePlacementRule.Reject, QueuePlacementRule.SecondaryGroupExistingQueue, QueuePlacementRule.Specified, QueuePlacementRule.User

@InterfaceAudience.Private
@InterfaceStability.Unstable
public abstract class QueuePlacementRule
extends Object


Nested Class Summary
static class QueuePlacementRule.Default
          Places apps in the specified default queue.
static class QueuePlacementRule.NestedUserQueue
          Places apps in queues with name of the submitter under the queue returned by the nested rule.
static class QueuePlacementRule.PrimaryGroup
          Places apps in queues by primary group of the submitter
static class QueuePlacementRule.Reject
          Rejects all apps
static class QueuePlacementRule.SecondaryGroupExistingQueue
          Places apps in queues by secondary group of the submitter Match will be made on first secondary group that exist in queues
static class QueuePlacementRule.Specified
          Places apps in queues by requested queue of the submitter
static class QueuePlacementRule.User
          Places apps in queues by username of the submitter
 
Field Summary
protected  boolean create
           
 
Constructor Summary
QueuePlacementRule()
           
 
Method Summary
 String assignAppToQueue(String requestedQueue, String user, org.apache.hadoop.security.Groups groups, Map<FSQueueType,Set<String>> configuredQueues)
           
protected abstract  String getQueueForApp(String requestedQueue, String user, org.apache.hadoop.security.Groups groups, Map<FSQueueType,Set<String>> configuredQueues)
          Applies this rule to an app with the given requested queue and user/group information.
 QueuePlacementRule initialize(boolean create, Map<String,String> args)
          Initializes the rule with any arguments.
 void initializeFromXml(Element el)
           
abstract  boolean isTerminal()
          Returns true if this rule never tells the policy to continue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

create

protected boolean create
Constructor Detail

QueuePlacementRule

public QueuePlacementRule()
Method Detail

initialize

public QueuePlacementRule initialize(boolean create,
                                     Map<String,String> args)
Initializes the rule with any arguments.

Parameters:
args - Additional attributes of the rule's xml element other than create.

assignAppToQueue

public String assignAppToQueue(String requestedQueue,
                               String user,
                               org.apache.hadoop.security.Groups groups,
                               Map<FSQueueType,Set<String>> configuredQueues)
                        throws IOException
Parameters:
requestedQueue - The queue explicitly requested.
user - The user submitting the app.
groups - The groups of the user submitting the app.
configuredQueues - The queues specified in the scheduler configuration.
Returns:
The queue to place the app into. An empty string indicates that we should continue to the next rule, and null indicates that the app should be rejected.
Throws:
IOException

initializeFromXml

public void initializeFromXml(Element el)
                       throws AllocationConfigurationException
Throws:
AllocationConfigurationException

isTerminal

public abstract boolean isTerminal()
Returns true if this rule never tells the policy to continue.


getQueueForApp

protected abstract String getQueueForApp(String requestedQueue,
                                         String user,
                                         org.apache.hadoop.security.Groups groups,
                                         Map<FSQueueType,Set<String>> configuredQueues)
                                  throws IOException
Applies this rule to an app with the given requested queue and user/group information.

Parameters:
requestedQueue - The queue specified in the ApplicationSubmissionContext
user - The user submitting the app.
groups - The groups of the user submitting the app.
Returns:
The name of the queue to assign the app to, or null to empty string continue to the next rule.
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.