当前位置: 首页>>代码示例>>Java>>正文


Java RMNodeLabelsManager.start方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager.start方法的典型用法代码示例。如果您正苦于以下问题:Java RMNodeLabelsManager.start方法的具体用法?Java RMNodeLabelsManager.start怎么用?Java RMNodeLabelsManager.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager的用法示例。


在下文中一共展示了RMNodeLabelsManager.start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testQueueParsingWhenLabelsNotExist

import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager; //导入方法依赖的package包/类
@Test
public void testQueueParsingWhenLabelsNotExist() throws IOException {
  YarnConfiguration conf = new YarnConfiguration();
  CapacitySchedulerConfiguration csConf =
      new CapacitySchedulerConfiguration(conf);
  setupQueueConfigurationWithLabels(csConf);

  CapacityScheduler capacityScheduler = new CapacityScheduler();
  RMContextImpl rmContext =
      new RMContextImpl(null, null, null, null, null, null,
          new RMContainerTokenSecretManager(csConf),
          new NMTokenSecretManagerInRM(csConf),
          new ClientToAMTokenSecretManagerInRM(), null);
  
  RMNodeLabelsManager nodeLabelsManager = new NullRMNodeLabelsManager();
  nodeLabelsManager.init(conf);
  nodeLabelsManager.start();
  
  rmContext.setNodeLabelManager(nodeLabelsManager);
  capacityScheduler.setConf(csConf);
  capacityScheduler.setRMContext(rmContext);
  capacityScheduler.init(csConf);
  capacityScheduler.start();
  ServiceOperations.stopQuietly(capacityScheduler);
  ServiceOperations.stopQuietly(nodeLabelsManager);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:TestQueueParsing.java

示例2: testQueueParsingWhenLabelsNotExistedInNodeLabelManager

import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager; //导入方法依赖的package包/类
@Test
public void testQueueParsingWhenLabelsNotExistedInNodeLabelManager()
    throws IOException {
  YarnConfiguration conf = new YarnConfiguration();
  CapacitySchedulerConfiguration csConf =
      new CapacitySchedulerConfiguration(conf);
  setupQueueConfigurationWithLabels(csConf);

  CapacityScheduler capacityScheduler = new CapacityScheduler();
  RMContextImpl rmContext =
      new RMContextImpl(null, null, null, null, null, null,
          new RMContainerTokenSecretManager(csConf),
          new NMTokenSecretManagerInRM(csConf),
          new ClientToAMTokenSecretManagerInRM(), null);
  
  RMNodeLabelsManager nodeLabelsManager = new NullRMNodeLabelsManager();
  nodeLabelsManager.init(conf);
  nodeLabelsManager.start();
  
  rmContext.setNodeLabelManager(nodeLabelsManager);
  capacityScheduler.setConf(csConf);
  capacityScheduler.setRMContext(rmContext);
  capacityScheduler.init(csConf);
  capacityScheduler.start();
  ServiceOperations.stopQuietly(capacityScheduler);
  ServiceOperations.stopQuietly(nodeLabelsManager);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:TestQueueParsing.java

示例3: testQueueParsingWhenLabelsInheritedNotExistedInNodeLabelManager

import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager; //导入方法依赖的package包/类
@Test
public void testQueueParsingWhenLabelsInheritedNotExistedInNodeLabelManager()
    throws IOException {
  YarnConfiguration conf = new YarnConfiguration();
  CapacitySchedulerConfiguration csConf =
      new CapacitySchedulerConfiguration(conf);
  setupQueueConfigurationWithLabelsInherit(csConf);

  CapacityScheduler capacityScheduler = new CapacityScheduler();
  RMContextImpl rmContext =
      new RMContextImpl(null, null, null, null, null, null,
          new RMContainerTokenSecretManager(csConf),
          new NMTokenSecretManagerInRM(csConf),
          new ClientToAMTokenSecretManagerInRM(), null);
  
  RMNodeLabelsManager nodeLabelsManager = new NullRMNodeLabelsManager();
  nodeLabelsManager.init(conf);
  nodeLabelsManager.start();
  
  rmContext.setNodeLabelManager(nodeLabelsManager);
  capacityScheduler.setConf(csConf);
  capacityScheduler.setRMContext(rmContext);
  capacityScheduler.init(csConf);
  capacityScheduler.start();
  ServiceOperations.stopQuietly(capacityScheduler);
  ServiceOperations.stopQuietly(nodeLabelsManager);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:TestQueueParsing.java

示例4: testSingleLevelQueueParsingWhenLabelsNotExistedInNodeLabelManager

import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager; //导入方法依赖的package包/类
@Test
public void testSingleLevelQueueParsingWhenLabelsNotExistedInNodeLabelManager()
    throws IOException {
  YarnConfiguration conf = new YarnConfiguration();
  CapacitySchedulerConfiguration csConf =
      new CapacitySchedulerConfiguration(conf);
  setupQueueConfigurationWithSingleLevel(csConf);

  CapacityScheduler capacityScheduler = new CapacityScheduler();
  RMContextImpl rmContext =
      new RMContextImpl(null, null, null, null, null, null,
          new RMContainerTokenSecretManager(csConf),
          new NMTokenSecretManagerInRM(csConf),
          new ClientToAMTokenSecretManagerInRM(), null);
  
  RMNodeLabelsManager nodeLabelsManager = new NullRMNodeLabelsManager();
  nodeLabelsManager.init(conf);
  nodeLabelsManager.start();
  
  rmContext.setNodeLabelManager(nodeLabelsManager);
  capacityScheduler.setConf(csConf);
  capacityScheduler.setRMContext(rmContext);
  capacityScheduler.init(csConf);
  capacityScheduler.start();
  ServiceOperations.stopQuietly(capacityScheduler);
  ServiceOperations.stopQuietly(nodeLabelsManager);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:TestQueueParsing.java

示例5: testCompareRMNodeAfterReconnect

import org.apache.hadoop.yarn.server.resourcemanager.nodelabels.RMNodeLabelsManager; //导入方法依赖的package包/类
@Test
public void testCompareRMNodeAfterReconnect() throws Exception {
  Configuration yarnConf = new YarnConfiguration();
  CapacityScheduler scheduler = new CapacityScheduler();
  scheduler.setConf(yarnConf);
  ConfigurationProvider configurationProvider =
      ConfigurationProviderFactory.getConfigurationProvider(yarnConf);
  configurationProvider.init(yarnConf);
  context.setConfigurationProvider(configurationProvider);
  RMNodeLabelsManager nlm = new RMNodeLabelsManager();
  nlm.init(yarnConf);
  nlm.start();
  context.setNodeLabelManager(nlm);
  scheduler.setRMContext(context);
  scheduler.init(yarnConf);
  scheduler.start();
  dispatcher.register(SchedulerEventType.class, scheduler);

  String hostname1 = "localhost1";
  Resource capability = BuilderUtils.newResource(4096, 4);

  RegisterNodeManagerRequest request1 = recordFactory
      .newRecordInstance(RegisterNodeManagerRequest.class);
  NodeId nodeId1 = NodeId.newInstance(hostname1, 0);
  request1.setNodeId(nodeId1);
  request1.setHttpPort(0);
  request1.setResource(capability);
  resourceTrackerService.registerNodeManager(request1);
  Assert.assertNotNull(context.getRMNodes().get(nodeId1));
  // verify Scheduler and RMContext use same RMNode reference.
  Assert.assertTrue(scheduler.getSchedulerNode(nodeId1).getRMNode() ==
      context.getRMNodes().get(nodeId1));
  Assert.assertEquals(context.getRMNodes().get(nodeId1).
      getTotalCapability(), capability);
  Resource capability1 = BuilderUtils.newResource(2048, 2);
  request1.setResource(capability1);
  resourceTrackerService.registerNodeManager(request1);
  Assert.assertNotNull(context.getRMNodes().get(nodeId1));
  // verify Scheduler and RMContext use same RMNode reference
  // after reconnect.
  Assert.assertTrue(scheduler.getSchedulerNode(nodeId1).getRMNode() ==
      context.getRMNodes().get(nodeId1));
  // verify RMNode's capability is changed.
  Assert.assertEquals(context.getRMNodes().get(nodeId1).
      getTotalCapability(), capability1);
  nlm.stop();
  scheduler.stop();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:49,代码来源:TestNMReconnect.java


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