• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java QueueState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.mapreduce.QueueState的典型用法代码示例。如果您正苦于以下问题:Java QueueState类的具体用法?Java QueueState怎么用?Java QueueState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



QueueState类属于org.apache.hadoop.mapreduce包,在下文中一共展示了QueueState类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createQueues

import org.apache.hadoop.mapreduce.QueueState; //导入依赖的package包/类
private List<Queue> createQueues(Configuration conf) {
  String[] queueNameValues = conf.getStrings(
    MAPRED_QUEUE_NAMES_KEY);
  List<Queue> list = new ArrayList<Queue>();
  for (String name : queueNameValues) {
    try {
      Map<String, AccessControlList> acls = getQueueAcls(
        name, conf);
      QueueState state = getQueueState(name, conf);
      Queue q = new Queue(name, acls, state);
      list.add(q);
    } catch (Throwable t) {
      LOG.warn("Not able to initialize queue " + name);
    }
  }
  return list;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:DeprecatedQueueConfigurationParser.java


示例2: getSimpleQueueHierarchy

import org.apache.hadoop.mapreduce.QueueState; //导入依赖的package包/类
/**
 * @return a simple hierarchy of JobQueueInfos
 */
static JobQueueInfo[] getSimpleQueueHierarchy() {
  int numQs = 3;
  JobQueueInfo[] queues = new JobQueueInfo[numQs];
  queues[0] =
      newJobQueueInfo(new ArrayList<JobQueueInfo>(), null, "q1",
          QueueState.UNDEFINED, null);
  queues[1] =
      newJobQueueInfo(new ArrayList<JobQueueInfo>(), null, "q1:q2",
          QueueState.RUNNING, null);
  queues[2] =
      newJobQueueInfo(new ArrayList<JobQueueInfo>(), null, "q1:q3",
          QueueState.RUNNING, null);
  queues[0].addChild(queues[1]);
  queues[0].addChild(queues[2]);
  return queues;
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:20,代码来源:TestQueueManagerRefresh.java


示例3: testRefreshWithAddedQueues

import org.apache.hadoop.mapreduce.QueueState; //导入依赖的package包/类
/**
 * Test to verify that the refresh of queue properties fails if a new queue is
 * added.
 * 
 * @throws Exception
 */
@Test
public void testRefreshWithAddedQueues()
    throws Exception {

  JobQueueInfo[] queues = getSimpleQueueHierarchy();

  // write the configuration file
  writeQueueConfigurationFile(
      QUEUES_CONFIG_FILE_PATH, new JobQueueInfo[] { queues[0] });

  QueueManager qManager = new QueueManager();

  JobQueueInfo newQueue =
      newJobQueueInfo(new ArrayList<JobQueueInfo>(), null, "q4",
          QueueState.UNDEFINED, null);
  queues[0].addChild(newQueue);

  // Rewrite the configuration file
  writeQueueConfigurationFile(
      QUEUES_CONFIG_FILE_PATH, new JobQueueInfo[] { queues[0] });

  testRefreshFailureWithChangeOfHierarchy(qManager);

}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:31,代码来源:TestQueueManagerRefresh.java


示例4: createSimpleDocument

import org.apache.hadoop.mapreduce.QueueState; //导入依赖的package包/类
/**
 * Creates all given queues as 1st level queues(no nesting)
 * @param doc         the queues config document
 * @param queueNames  the queues to be added to the queues config document
 * @param submitAcls  acl-submit-job acls for each of the queues
 * @param adminsAcls  acl-administer-jobs acls for each of the queues
 * @throws Exception
 */
public static void createSimpleDocument(Document doc, String[] queueNames,
    String[] submitAcls, String[] adminsAcls) throws Exception {

  Element queues = createQueuesNode(doc);

  // Create all queues as 1st level queues(no nesting)
  for (int i = 0; i < queueNames.length; i++) {
    Element q = createQueue(doc, queueNames[i]);

    q.appendChild(createState(doc, QueueState.RUNNING.getStateName()));
    q.appendChild(createAcls(doc,
        QueueConfigurationParser.ACL_SUBMIT_JOB_TAG, submitAcls[i]));
    q.appendChild(createAcls(doc,
        QueueConfigurationParser.ACL_ADMINISTER_JOB_TAG, adminsAcls[i]));
    queues.appendChild(q);
  }
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:26,代码来源:QueueManagerTestUtils.java


示例5: setQueues

import org.apache.hadoop.mapreduce.QueueState; //导入依赖的package包/类
void setQueues(Set<String> queueNames) {
  this.queueNames = queueNames;

  // sync up queues with the parent class.
  Queue[] queues = new Queue[queueNames.size()];
  int i = 0;
  for (String queueName : queueNames) {
    HashMap<String, AccessControlList> aclsMap
      = new HashMap<String, AccessControlList>();
    for (QueueACL qAcl : QueueACL.values()) {
      String key = toFullPropertyName(queueName, qAcl.getAclName());
      aclsMap.put(key, allEnabledAcl);
    }
    queues[i++] = new Queue(queueName, aclsMap, QueueState.RUNNING);
  }
  super.setQueues(queues);
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:18,代码来源:CapacityTestUtils.java


示例6: isRunning

import org.apache.hadoop.mapreduce.QueueState; //导入依赖的package包/类
/**
 * Checks whether the given queue is running or not.
 *
 * @param queueName name of the queue
 * @return true, if the queue is running.
 */
synchronized boolean isRunning(String queueName) {
  Queue q = leafQueues.get(queueName);
  if (q != null) {
    return q.getState().equals(QueueState.RUNNING);
  }
  return false;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:QueueManager.java


示例7: getQueueState

import org.apache.hadoop.mapreduce.QueueState; //导入依赖的package包/类
/**
 * Only applicable to leaf level queues
 * Parse ACLs for the queue from the configuration.
 */
private QueueState getQueueState(String name, Configuration conf) {
  String stateVal = conf.get(
      toFullPropertyName(name, "state"),
      QueueState.RUNNING.getStateName());
  return QueueState.getState(stateVal);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:DeprecatedQueueConfigurationParser.java


示例8: newJobQueueInfo

import org.apache.hadoop.mapreduce.QueueState; //导入依赖的package包/类
static JobQueueInfo newJobQueueInfo(List<JobQueueInfo> children,
    Properties props, String queueName, QueueState state,
    String schedulingInfo) {
  JobQueueInfo jqi = new JobQueueInfo();
  jqi.setChildren(children);
  if (props != null) {
    jqi.setProperties(props);
  }
  jqi.setQueueName(queueName);
  jqi.setQueueState(state.getStateName());
  jqi.setSchedulingInfo(schedulingInfo);
  return jqi;
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:14,代码来源:TestQueueManagerRefresh.java


示例9: refreshSimpleDocument

import org.apache.hadoop.mapreduce.QueueState; //导入依赖的package包/类
public static void refreshSimpleDocument(Document doc) throws Exception {
  Element queues = createQueuesNode(doc);

  // Create parent level queue q1.
  Element q1 = createQueue(doc, "q1");
  Properties props = new Properties();
  props.setProperty("capacity", "70");
  props.setProperty("maxCapacity", "35");
  q1.appendChild(createProperties(doc, props));
  queues.appendChild(q1);

  // Create another parent level p1
  Element p1 = createQueue(doc, "p1");

  // append child p11 to p1
  Element p11 = createQueue(doc, "p11");
  p11.appendChild(createState(doc, QueueState.STOPPED.getStateName()));
  p1.appendChild(p11);

  Element p12 = createQueue(doc, "p12");

  p12.appendChild(createState(doc, QueueState.RUNNING.getStateName()));
  p12.appendChild(createAcls(doc, "acl-submit-job", "u3"));
  p12.appendChild(createAcls(doc, "acl-administer-jobs", "u4"));

  // append p12 to p1.
  p1.appendChild(p12);

  queues.appendChild(p1);
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:31,代码来源:QueueManagerTestUtils.java



注:本文中的org.apache.hadoop.mapreduce.QueueState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CacheRemove类代码示例发布时间:2022-05-22
下一篇:
Java InvalidMessageException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap