org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.QueueManager.createQueue()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(78)

本文整理了Java中org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.QueueManager.createQueue方法的一些代码示例,展示了QueueManager.createQueue的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueueManager.createQueue方法的具体详情如下:
包路径:org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.QueueManager
类名称:QueueManager
方法名:createQueue

QueueManager.createQueue介绍

[英]Creates a leaf or parent queue based on what is specified in 'queueType' and places it in the tree. Creates any parents that don't already exist.
[中]根据“queueType”中指定的内容创建叶或父队列,并将其放置在树中。创建任何不存在的父级。

代码示例

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

private FSQueue getQueue(String name, boolean create, FSQueueType queueType) {
 name = ensureRootPrefix(name);
 synchronized (queues) {
  FSQueue queue = queues.get(name);
  if (queue == null && create) {
   // if the queue doesn't exist,create it and return
   queue = createQueue(name, queueType);
   // Update steady fair share for all queues
   if (queue != null) {
    rootQueue.recomputeSteadyShares();
   }
  }
  return queue;
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private FSQueue getQueue(String name, boolean create, FSQueueType queueType) {
 name = ensureRootPrefix(name);
 synchronized (queues) {
  FSQueue queue = queues.get(name);
  if (queue == null && create) {
   // if the queue doesn't exist,create it and return
   queue = createQueue(name, queueType);
   // Update steady fair share for all queues
   if (queue != null) {
    rootQueue.recomputeSteadyShares();
   }
  }
  return queue;
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private FSQueue getQueue(String name, boolean create, FSQueueType queueType,
  boolean recomputeSteadyShares, ApplicationId applicationId) {
 boolean recompute = recomputeSteadyShares;
 name = ensureRootPrefix(name);
 FSQueue queue;
 synchronized (queues) {
  queue = queues.get(name);
  if (queue == null && create) {
   // if the queue doesn't exist,create it and return
   queue = createQueue(name, queueType);
  } else {
   recompute = false;
  }
  // At this point the queue exists and we need to assign the app if to the
  // but only to a leaf queue
  if (applicationId != null && queue instanceof FSLeafQueue) {
   ((FSLeafQueue)queue).addAssignedApp(applicationId);
  }
 }
 // Don't recompute if it is an existing queue or no change was made
 if (recompute && queue != null) {
  rootQueue.recomputeSteadyShares();
 }
 return queue;
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

/**
 * Test creation of a simple parent queue.
 */
@Test
public void testCreateParentQueue() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 queueManager.updateAllocationConfiguration(allocConf);
 FSQueue q1 = queueManager.createQueue("root.queue1", FSQueueType.PARENT);
 assertNotNull("Parent queue root.queue1 was not created",
   queueManager.getParentQueue("root.queue1", false));
 assertEquals("createQueue() returned wrong queue",
   "root.queue1", q1.getName());
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

/**
 * Test simple leaf queue creation.
 */
@Test
public void testCreateLeafQueue() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 queueManager.updateAllocationConfiguration(allocConf);
 FSQueue q1 = queueManager.createQueue("root.queue1", FSQueueType.LEAF);
 assertNotNull("Leaf queue root.queue1 was not created",
   queueManager.getLeafQueue("root.queue1", false));
 assertEquals("createQueue() returned wrong queue",
   "root.queue1", q1.getName());
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

/**
 * Test creation of a leaf queue and its parent.
 */
@Test
public void testCreateLeafQueueAndParent() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 queueManager.updateAllocationConfiguration(allocConf);
 FSQueue q2 = queueManager.createQueue("root.queue1.queue2",
   FSQueueType.LEAF);
 assertNotNull("Parent queue root.queue1 was not created",
   queueManager.getParentQueue("root.queue1", false));
 assertNotNull("Leaf queue root.queue1.queue2 was not created",
   queueManager.getLeafQueue("root.queue1.queue2", false));
 assertEquals("createQueue() returned wrong queue",
   "root.queue1.queue2", q2.getName());
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

/**
 * Test creation of a parent queue and its parent.
 */
@Test
public void testCreateParentQueueAndParent() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 queueManager.updateAllocationConfiguration(allocConf);
 FSQueue q2 = queueManager.createQueue("root.queue1.queue2",
   FSQueueType.PARENT);
 assertNotNull("Parent queue root.queue1 was not created",
   queueManager.getParentQueue("root.queue1", false));
 assertNotNull("Leaf queue root.queue1.queue2 was not created",
   queueManager.getParentQueue("root.queue1.queue2", false));
 assertEquals("createQueue() returned wrong queue",
   "root.queue1.queue2", q2.getName());
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

/**
 * Test creation of a leaf queue with no resource limits.
 */
@Test
public void testCreateLeafQueueWithDefaults() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 FSQueue q1 = queueManager.createQueue("root.queue1", FSQueueType.LEAF);
 assertNotNull("Leaf queue root.queue1 was not created",
   queueManager.getLeafQueue("root.queue1", false));
 assertEquals("createQueue() returned wrong queue",
   "root.queue1", q1.getName());
 // Min default is 0,0
 assertEquals("Min resources were not set to default",
   Resources.createResource(0, 0),
   q1.getMinShare());
 // Max default is unbounded
 assertEquals("Max resources were not set to default", Resources.unbounded(),
   q1.getMaxShare());
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

new ConfigurableResource(Resources.createResource(8192, 256)));
FSQueue q1 = queueManager.createQueue("root.test.childC", FSQueueType.LEAF);
assertNotNull("Leaf queue root.test.childC was not created",
  queueManager.getLeafQueue("root.test.childC", false));
  q1.getMaxShare());
FSQueue q2 = queueManager.createQueue("root.test.childD",
  FSQueueType.PARENT);

相关文章