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

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

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class QueuePlacementPolicy
extends Object


Constructor Summary
QueuePlacementPolicy(List<QueuePlacementRule> rules, Map<FSQueueType,Set<String>> configuredQueues, org.apache.hadoop.conf.Configuration conf)
           
 
Method Summary
 String assignAppToQueue(String requestedQueue, String user)
          Applies this rule to an app with the given requested queue and user/group information.
static QueuePlacementRule createAndInitializeRule(Node node)
          Create and initialize a rule given a xml node
static QueuePlacementPolicy fromConfiguration(org.apache.hadoop.conf.Configuration conf, Map<FSQueueType,Set<String>> configuredQueues)
          Build a simple queue placement policy from the allow-undeclared-pools and user-as-default-queue configuration options.
static QueuePlacementPolicy fromXml(Element el, Map<FSQueueType,Set<String>> configuredQueues, org.apache.hadoop.conf.Configuration conf)
          Builds a QueuePlacementPolicy from an xml element.
 List<QueuePlacementRule> getRules()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueuePlacementPolicy

public QueuePlacementPolicy(List<QueuePlacementRule> rules,
                            Map<FSQueueType,Set<String>> configuredQueues,
                            org.apache.hadoop.conf.Configuration conf)
                     throws AllocationConfigurationException
Throws:
AllocationConfigurationException
Method Detail

fromXml

public static QueuePlacementPolicy fromXml(Element el,
                                           Map<FSQueueType,Set<String>> configuredQueues,
                                           org.apache.hadoop.conf.Configuration conf)
                                    throws AllocationConfigurationException
Builds a QueuePlacementPolicy from an xml element.

Throws:
AllocationConfigurationException

createAndInitializeRule

public static QueuePlacementRule createAndInitializeRule(Node node)
                                                  throws AllocationConfigurationException
Create and initialize a rule given a xml node

Parameters:
node -
Returns:
QueuePlacementPolicy
Throws:
AllocationConfigurationException

fromConfiguration

public static QueuePlacementPolicy fromConfiguration(org.apache.hadoop.conf.Configuration conf,
                                                     Map<FSQueueType,Set<String>> configuredQueues)
Build a simple queue placement policy from the allow-undeclared-pools and user-as-default-queue configuration options.


assignAppToQueue

public String assignAppToQueue(String requestedQueue,
                               String user)
                        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
Returns:
The name of the queue to assign the app to. Or null if the app should be rejected.
Throws:
IOException - If an exception is encountered while getting the user's groups

getRules

public List<QueuePlacementRule> getRules()


Copyright © 2014 Apache Software Foundation. All Rights Reserved.