@InterfaceAudience.Private public class QueueManager extends Object
The Map/Reduce framework can be configured with one or more queues, depending on the scheduler it is configured with. While some schedulers work only with one queue, some schedulers support multiple queues. Some schedulers also support the notion of queues within queues - a feature called hierarchical queues.
Queue names are unique, and used as a key to lookup queues. Hierarchical queues are named by a 'fully qualified name' such as q1:q2:q3, where q2 is a child queue of q1 and q3 is a child queue of q2.
Leaf level queues are queues that contain no queues within them. Jobs can be submitted only to leaf level queues.
Queues can be configured with various properties. Some of these properties are common to all schedulers, and those are handled by this class. Schedulers might also associate several custom properties with queues. These properties are parsed and maintained per queue by the framework. If schedulers need more complicated structure to maintain configuration per queue, they are free to not use the facilities provided by the framework, but define their own mechanisms. In such cases, it is likely that the name of the queue will be used to relate the common properties of a queue with scheduler specific properties.
Information related to a queue, such as its name, properties, scheduling
information and children are exposed by this class via a serializable
class called JobQueueInfo
.
Queues are configured in the configuration file mapred-queues.xml. To support backwards compatibility, queues can also be configured in mapred-site.xml. However, when configured in the latter, there is no support for hierarchical queues.
Modifier and Type | Field and Description |
---|---|
static String |
QUEUE_CONF_FILE_NAME |
Constructor and Description |
---|
QueueManager(org.apache.hadoop.conf.Configuration clusterConf)
Construct a new QueueManager using configuration specified in the passed
in
Configuration object. |
Modifier and Type | Method and Description |
---|---|
Set<String> |
getLeafQueueNames()
Return the set of leaf level queues configured in the system to
which jobs are submitted.
|
Object |
getSchedulerInfo(String queueName)
Return the scheduler information configured for this queue.
|
boolean |
hasAccess(String queueName,
QueueACL qACL,
org.apache.hadoop.security.UserGroupInformation ugi)
Return true if the given user is part of the ACL for the given
QueueACL name for the given queue. |
void |
setSchedulerInfo(String queueName,
Object queueInfo)
Set a generic Object that represents scheduling information relevant
to a queue.
|
static String |
toFullPropertyName(String queue,
String property) |
public static final String QUEUE_CONF_FILE_NAME
public QueueManager(org.apache.hadoop.conf.Configuration clusterConf)
Configuration
object.
This instance supports queue configuration specified in mapred-site.xml, but without support for hierarchical queues. If no queue configuration is found in mapred-site.xml, it will then look for site configuration in mapred-queues.xml supporting hierarchical queues.
clusterConf
- mapreduce cluster configurationpublic Set<String> getLeafQueueNames()
The number of queues configured should be dependent on the Scheduler configured. Note that some schedulers work with only one queue, whereas others can support multiple queues.
public boolean hasAccess(String queueName, QueueACL qACL, org.apache.hadoop.security.UserGroupInformation ugi)
QueueACL
name for the given queue.
An operation is allowed if all users are provided access for this operation, or if either the user or any of the groups specified is provided access.
queueName
- Queue on which the operation needs to be performed.qACL
- The queue ACL name to be checkedugi
- The user and groups who wish to perform the operation.public void setSchedulerInfo(String queueName, Object queueInfo)
A string representation of this Object will be used by the framework to display in user facing applications like the JobTracker web UI and the hadoop CLI.
queueName
- queue for which the scheduling information is to be set.queueInfo
- scheduling information for this queue.public Object getSchedulerInfo(String queueName)
queueName
- queue for which the scheduling information is required.Copyright © 2018 Apache Software Foundation. All Rights Reserved.