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

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

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

QueueManager.updateAllocationConfiguration介绍

暂无

代码示例

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

@Override
 public void onReload(AllocationConfiguration queueInfo) {
  // Commit the reload; also create any queue defined in the alloc file
  // if it does not already exist, so it can be displayed on the web UI.
  synchronized (FairScheduler.this) {
   allocConf = queueInfo;
   allocConf.getDefaultSchedulingPolicy().initialize(clusterResource);
   queueMgr.updateAllocationConfiguration(allocConf);
   maxRunningEnforcer.updateRunnabilityOnReload();
  }
 }
}

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

private void updateConfiguredLeafQueues(QueueManager queueMgr, String... confLeafQueues) {
  AllocationConfiguration allocConf = new AllocationConfiguration(conf);
  allocConf.configuredQueues.get(FSQueueType.LEAF).addAll(Sets.newHashSet(confLeafQueues));
  queueMgr.updateAllocationConfiguration(allocConf);
 }
}

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

@Override
 public void onReload(AllocationConfiguration queueInfo) {
  // Commit the reload; also create any queue defined in the alloc file
  // if it does not already exist, so it can be displayed on the web UI.
  synchronized (FairScheduler.this) {
   allocConf = queueInfo;
   allocConf.getDefaultSchedulingPolicy().initialize(clusterResource);
   queueMgr.updateAllocationConfiguration(allocConf);
   maxRunningEnforcer.updateRunnabilityOnReload();
  }
 }
}

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

private void updateConfiguredLeafQueues(QueueManager queueMgr, String... confLeafQueues) {
 AllocationConfiguration allocConf = new AllocationConfiguration(conf);
 allocConf.configuredQueues.get(FSQueueType.LEAF).addAll(Sets.newHashSet(confLeafQueues));
 queueMgr.updateAllocationConfiguration(allocConf);
}

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

@Override
public void onReload(AllocationConfiguration queueInfo)
  throws IOException {
 // Commit the reload; also create any queue defined in the alloc file
 // if it does not already exist, so it can be displayed on the web UI.
 Set<String> removedStaticQueues = getRemovedStaticQueues(queueInfo);
 writeLock.lock();
 try {
  if (queueInfo == null) {
   authorizer.setPermission(allocsLoader.getDefaultPermissions(),
     UserGroupInformation.getCurrentUser());
  } else {
   allocConf = queueInfo;
   setQueueAcls(allocConf.getQueueAcls());
   allocConf.getDefaultSchedulingPolicy().initialize(getContext());
   queueMgr.updateAllocationConfiguration(allocConf);
   queueMgr.setQueuesToDynamic(removedStaticQueues);
   applyChildDefaults();
   maxRunningEnforcer.updateRunnabilityOnReload();
  }
 } finally {
  writeLock.unlock();
 }
}

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

@Test
public void testReloadTurnsLeafToParentWithNoLeaf() {
 AllocationConfiguration allocConf = new AllocationConfiguration(conf);
 // Create a leaf queue1
 allocConf.configuredQueues.get(FSQueueType.LEAF).add("root.queue1");
 queueManager.updateAllocationConfiguration(allocConf);
 assertNotNull(queueManager.getLeafQueue("root.queue1", false));
 // Lets say later on admin makes queue1 a parent queue by
 // specifying "type=parent" in the alloc xml and lets say apps running in
 // queue1
 notEmptyQueues.add(queueManager.getLeafQueue("root.queue1", false));
 allocConf = new AllocationConfiguration(conf);
 allocConf.configuredQueues.get(FSQueueType.PARENT)
   .add("root.queue1");
 // When allocs are reloaded queue1 shouldn't be converter to parent
 queueManager.updateAllocationConfiguration(allocConf);
 assertNotNull(queueManager.getLeafQueue("root.queue1", false));
 assertNull(queueManager.getParentQueue("root.queue1", false));
 // Now lets assume apps completed and there are no apps in queue1
 notEmptyQueues.clear();
 // We should see queue1 transform from leaf queue to parent queue.
 queueManager.updateAllocationConfiguration(allocConf);
 assertNull(queueManager.getLeafQueue("root.queue1", false));
 assertNotNull(queueManager.getParentQueue("root.queue1", false));
 // this parent should not have any children
 assertTrue(queueManager.getParentQueue("root.queue1", false)
   .getChildQueues().isEmpty());
}

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

@Test
public void testReloadTurnsLeafToParentWithNoLeaf() {
 AllocationConfiguration allocConf = new AllocationConfiguration(conf);
 // Create a leaf queue1
 allocConf.configuredQueues.get(FSQueueType.LEAF).add("root.queue1");
 queueManager.updateAllocationConfiguration(allocConf);
 assertNotNull(queueManager.getLeafQueue("root.queue1", false));
 // Lets say later on admin makes queue1 a parent queue by
 // specifying "type=parent" in the alloc xml and lets say apps running in
 // queue1
 notEmptyQueues.add(queueManager.getLeafQueue("root.queue1", false));
 allocConf = new AllocationConfiguration(conf);
 allocConf.configuredQueues.get(FSQueueType.PARENT)
   .add("root.queue1");
 // When allocs are reloaded queue1 shouldn't be converter to parent
 queueManager.updateAllocationConfiguration(allocConf);
 assertNotNull(queueManager.getLeafQueue("root.queue1", false));
 assertNull(queueManager.getParentQueue("root.queue1", false));
 // Now lets assume apps completed and there are no apps in queue1
 notEmptyQueues.clear();
 // We should see queue1 transform from leaf queue to parent queue.
 queueManager.updateAllocationConfiguration(allocConf);
 assertNull(queueManager.getLeafQueue("root.queue1", false));
 assertNotNull(queueManager.getParentQueue("root.queue1", false));
 // this parent should not have any children
 assertTrue(queueManager.getParentQueue("root.queue1", false)
   .getChildQueues().isEmpty());
}

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

@Test
public void testQueueTypeChange() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 queueManager.updateAllocationConfiguration(allocConf);
 queueManager.updateAllocationConfiguration(allocConf);
 q1 = queueManager.getLeafQueue("root.parent1.leaf1", false);
 assertFalse("root.parent1.leaf1 is not a static queue", q1.isDynamic());
 queueManager.updateAllocationConfiguration(allocConf);
 queueManager.setQueuesToDynamic(
   ImmutableSet.of("root.parent1", "root.parent1.leaf1"));

代码示例来源: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

allocConf.configuredQueues.get(FSQueueType.LEAF).add("root.a");
scheduler.allocConf = allocConf;
queueManager.updateAllocationConfiguration(allocConf);
allocConf.configuredQueues.get(FSQueueType.PARENT).add("root.a");
allocConf.configuredQueues.get(FSQueueType.LEAF).add("root.a.b");
queueManager.updateAllocationConfiguration(allocConf);

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

@Test
public void testRemovalOfChildlessParentQueue() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 queueManager.updateAllocationConfiguration(allocConf);
 FSParentQueue q1 = queueManager.getParentQueue("root.test.childB", false);
 assertNotNull("Queue root.test.childB was not created", q1);
 assertEquals("createQueue() returned wrong queue",
   "root.test.childB", q1.getName());
 assertFalse("root.test.childB is a dynamic queue", q1.isDynamic());
 // static queues should not be deleted
 queueManager.removePendingIncompatibleQueues();
 queueManager.removeEmptyDynamicQueues();
 q1 = queueManager.getParentQueue("root.test.childB", false);
 assertNotNull("Queue root.test.childB was deleted", q1);
 // next we remove root.test.childB from the allocation config
 allocConf.configuredQueues.get(FSQueueType.PARENT)
   .remove("root.test.childB");
 queueManager.updateAllocationConfiguration(allocConf);
 queueManager.setQueuesToDynamic(Collections.singleton("root.test.childB"));
 // the next removeEmptyDynamicQueues() call should clean
 // root.test.childB up
 queueManager.removePendingIncompatibleQueues();
 queueManager.removeEmptyDynamicQueues();
 q1 = queueManager.getParentQueue("root.leaf1", false);
 assertNull("Queue root.leaf1 was not deleted", q1);
}

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

AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
queueManager.updateAllocationConfiguration(allocConf);
queueManager.updateAllocationConfiguration(allocConf);

代码示例来源: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
public void testNonEmptyStaticQueueBecomingDynamicQueue() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 queueManager.updateAllocationConfiguration(allocConf);
  queueNames.clear();
 queueManager.updateAllocationConfiguration(allocConf);

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

@Test
public void testRemovalOfDynamicLeafQueue() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 queueManager.updateAllocationConfiguration(allocConf);
 FSQueue q1 = queueManager.getLeafQueue("root.test.childB.dynamic1", true);
 assertNotNull("Queue root.test.childB.dynamic1 was not created", q1);
 assertEquals("createQueue() returned wrong queue",
   "root.test.childB.dynamic1", q1.getName());
 assertTrue("root.test.childB.dynamic1 is not a dynamic queue",
   q1.isDynamic());
 // an application is submitted to root.test.childB.dynamic1
 notEmptyQueues.add(q1);
 // root.test.childB.dynamic1 is not empty and should not be removed
 queueManager.removePendingIncompatibleQueues();
 queueManager.removeEmptyDynamicQueues();
 q1 = queueManager.getLeafQueue("root.test.childB.dynamic1", false);
 assertNotNull("Queue root.test.childB.dynamic1 was deleted", q1);
 // the application finishes, the next removeEmptyDynamicQueues() should
 // clean root.test.childB.dynamic1 up, but keep its static parent
 notEmptyQueues.remove(q1);
 queueManager.removePendingIncompatibleQueues();
 queueManager.removeEmptyDynamicQueues();
 q1 = queueManager.getLeafQueue("root.test.childB.dynamic1", false);
 assertNull("Queue root.test.childB.dynamic1 was not deleted", q1);
 assertNotNull("The static parent of root.test.childB.dynamic1 was deleted",
   queueManager.getParentQueue("root.test.childB", false));
}

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

@Test
public void testRemovalOfDynamicParentQueue() {
 AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
 queueManager.updateAllocationConfiguration(allocConf);
 FSQueue q1 = queueManager.getLeafQueue("root.parent1.dynamic1", true);
 assertNotNull("Queue root.parent1.dynamic1 was not created", q1);
 assertEquals("createQueue() returned wrong queue",
   "root.parent1.dynamic1", q1.getName());
 assertTrue("root.parent1.dynamic1 is not a dynamic queue", q1.isDynamic());
 FSQueue p1 = queueManager.getParentQueue("root.parent1", false);
 assertNotNull("Queue root.parent1 was not created", p1);
 assertTrue("root.parent1 is not a dynamic queue", p1.isDynamic());
 queueManager.removePendingIncompatibleQueues();
 queueManager.removeEmptyDynamicQueues();
 q1 = queueManager.getLeafQueue("root.parent1.dynamic1", false);
 p1 = queueManager.getParentQueue("root.parent1", false);
 assertNull("Queue root.parent1.dynamic1 was not deleted", q1);
 assertNull("Queue root.parent1 was not deleted", p1);
}

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

queueManager = new QueueManager(scheduler);
queueManager.initialize(conf);
queueManager.updateAllocationConfiguration(allocConf);

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

AllocationConfiguration allocConf = scheduler.getAllocationConfiguration();
queueManager.updateAllocationConfiguration(allocConf);
queueManager.getQueue("root.test").setMaxChildQueueResource(
  new ConfigurableResource(Resources.createResource(8192, 256)));

相关文章