org.apache.hadoop.mapred.QueueManager.refreshQueues()方法的使用及代码示例

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

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

QueueManager.refreshQueues介绍

[英]Refresh acls, state and scheduler properties for the configured queues.

This method reloads configuration related to queues, but does not support changes to the list of queues or hierarchy. The expected usage is that an administrator can modify the queue configuration file and fire an admin command to reload queue configuration. If there is a problem in reloading configuration, then this method guarantees that existing queue configuration is untouched and in a consistent state.
[中]刷新已配置队列的ACL、状态和计划程序属性。
此方法重新加载与队列相关的配置,但不支持更改队列列表或层次结构。预期用途是,管理员可以修改队列配置文件,并发出admin命令以重新加载队列配置。如果在重新加载配置时出现问题,那么该方法可以确保现有队列配置未被触及,并且处于一致状态。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-mapred

@Override
public void refreshQueues() throws IOException{
 LOG.info("Refreshing queue information. requested by : " + 
      UserGroupInformation.getCurrentUser().getShortUserName());
 synchronized (taskScheduler) {
  queueManager.refreshQueues(new Configuration(this.conf), taskScheduler
    .getQueueRefresher());
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-core

assertEquals(qai.length, 1);
manager.refreshQueues(getConfiguration(), null);

代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test

/**
 * @param originalQManager
 * @throws Exception
 */
private void testRefreshFailureWithChangeOfHierarchy(
  QueueManager originalQManager)
  throws Exception {
 // Make sure that isHierarchySame returns false.
 QueueManager modifiedQueueManager = new QueueManager();
 assertFalse("Hierarchy changed after refresh!",
   originalQManager.getRoot().isHierarchySameAs(
     modifiedQueueManager.getRoot()));
 // Refresh the QueueManager and make sure it fails.
 try {
  originalQManager.refreshQueues(null, null);
  fail("Queue-refresh should have failed!");
 } catch (Exception e) {
  // Refresh failed as expected. Check the error message.
  assertTrue(
    "Exception message should point to a change in queue hierarchy!",
    e.getMessage().contains(
      QueueManager.MSG_REFRESH_FAILURE_WITH_CHANGE_OF_HIERARCHY));
 }
 // Make sure that the old configuration is retained.
 List<JobQueueInfo> rootQueues =
   originalQManager.getRoot().getJobQueueInfo().getChildren();
 assertTrue(rootQueues.size() == 1);
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test

/**
 * Test to verify that the refresh of queue properties fails if scheduler
 * fails to reload itself.
 * 
 * @throws Exception
 */
// @Test
public void testRefreshWithSchedulerFailure()
  throws Exception {
 JobQueueInfo[] queues = getSimpleQueueHierarchy();
 // write the configuration file
 writeQueueConfigurationFile(
   QUEUES_CONFIG_FILE_PATH, new JobQueueInfo[] { queues[0] });
 QueueManager qManager = new QueueManager();
 // No change in configuration. Just Refresh the QueueManager and make sure
 // it fails.
 try {
  qManager.refreshQueues(null,
    new MyTaskScheduler().new MyFailingQueueRefresher());
  fail("Queue-refresh should have failed!");
 } catch (Exception e) {
  // Refresh failed as expected. Check the error message.
  assertTrue(
    "Exception message should point to a refresh-failure in scheduler!",
    e.getMessage().contains(
      QueueManager.MSG_REFRESH_FAILURE_WITH_SCHEDULER_FAILURE));
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test

qManager.refreshQueues(null, myScheduler.new MyQueueRefresher());

代码示例来源:origin: org.apache.hadoop/hadoop-mapred-test

/**
 * Test to verify that the scheduling information per queue in the
 * {@link QueueManager} is retained across queue-refresh.
 * 
 * @throws Exception
 */
@Test
public void testSchedulingInfoAfterRefresh()
  throws Exception {
 JobQueueInfo[] queues = getSimpleQueueHierarchy();
 // write the configuration file
 writeQueueConfigurationFile(
   QUEUES_CONFIG_FILE_PATH, new JobQueueInfo[] { queues[0] });
 QueueManager qManager = new QueueManager();
 // Set some scheduling information for the queues in the QueueManager.
 for (String qName : qManager.getLeafQueueNames()) {
  qManager.setSchedulerInfo(qName, new String(
    "scheduling-information-for-queue-" + qName));
 }
 qManager.refreshQueues(null, null);
 // Verify that the scheduling information is retained across refresh.
 for (String qName : qManager.getLeafQueueNames()) {
  assertEquals("scheduling-information-for-queue-" + qName,
    qManager.getSchedulerInfo(qName));
 }
}

相关文章