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


Java ResourceTrackerService类代码示例

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


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

示例1: setUp

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
@Before
public void setUp() {
  Configuration conf = new Configuration();
  // Dispatcher that processes events inline
  Dispatcher dispatcher = new InlineDispatcher();
  dispatcher.register(SchedulerEventType.class, new EventHandler<Event>() {
    @Override
    public void handle(Event event) {
      ; // ignore
    }
  });
  RMContext context =
      new RMContextImpl(dispatcher, null, null, null, null,
        null, new RMContainerTokenSecretManager(conf),
        new NMTokenSecretManagerInRM(conf), null, null);
  dispatcher.register(RMNodeEventType.class,
      new ResourceManager.NodeEventDispatcher(context));
  NodesListManager nodesListManager = new NodesListManager(context);
  nodesListManager.init(conf);
  
  context.getContainerTokenSecretManager().rollMasterKey();
  context.getNMTokenSecretManager().rollMasterKey();
  resourceTrackerService = new ResourceTrackerService(context,
      nodesListManager, new NMLivelinessMonitor(dispatcher),
      context.getContainerTokenSecretManager(),
      context.getNMTokenSecretManager());
  resourceTrackerService.init(conf);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:29,代码来源:TestRMNMRPCResponseId.java

示例2: setUp

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
@Before
public void setUp() {
  Configuration conf = new Configuration();
  // Dispatcher that processes events inline
  Dispatcher dispatcher = new InlineDispatcher();
  RMContext context = new RMContextImpl(dispatcher, null,
      null, null, null, null, null, null, null, null);
  dispatcher.register(SchedulerEventType.class,
      new InlineDispatcher.EmptyEventHandler());
  dispatcher.register(RMNodeEventType.class,
      new NodeEventDispatcher(context));
  NMLivelinessMonitor nmLivelinessMonitor = new TestNmLivelinessMonitor(
      dispatcher);
  nmLivelinessMonitor.init(conf);
  nmLivelinessMonitor.start();
  NodesListManager nodesListManager = new NodesListManager(context);
  nodesListManager.init(conf);
  RMContainerTokenSecretManager containerTokenSecretManager =
      new RMContainerTokenSecretManager(conf);
  containerTokenSecretManager.start();
  NMTokenSecretManagerInRM nmTokenSecretManager =
      new NMTokenSecretManagerInRM(conf);
  nmTokenSecretManager.start();
  resourceTrackerService = new ResourceTrackerService(context,
      nodesListManager, nmLivelinessMonitor, containerTokenSecretManager,
      nmTokenSecretManager);
  
  resourceTrackerService.init(conf);
  resourceTrackerService.start();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:31,代码来源:TestNMExpiry.java

示例3: setUp

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
@Before
public void setUp() {
  Configuration conf = new Configuration();
  // Dispatcher that processes events inline
  Dispatcher dispatcher = new InlineDispatcher();

  dispatcher.register(RMNodeEventType.class,
      new TestRMNodeEventDispatcher());

  RMContext context = new RMContextImpl(dispatcher, null,
      null, null, null, null, null, null, null, null);
  dispatcher.register(SchedulerEventType.class,
      new InlineDispatcher.EmptyEventHandler());
  dispatcher.register(RMNodeEventType.class,
      new NodeEventDispatcher(context));
  NMLivelinessMonitor nmLivelinessMonitor = new NMLivelinessMonitor(
      dispatcher);
  nmLivelinessMonitor.init(conf);
  nmLivelinessMonitor.start();
  NodesListManager nodesListManager = new NodesListManager(context);
  nodesListManager.init(conf);
  RMContainerTokenSecretManager containerTokenSecretManager =
      new RMContainerTokenSecretManager(conf);
  containerTokenSecretManager.start();
  NMTokenSecretManagerInRM nmTokenSecretManager =
      new NMTokenSecretManagerInRM(conf);
  nmTokenSecretManager.start();
  resourceTrackerService = new ResourceTrackerService(context,
      nodesListManager, nmLivelinessMonitor, containerTokenSecretManager,
      nmTokenSecretManager);
  
  resourceTrackerService.init(conf);
  resourceTrackerService.start();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:35,代码来源:TestNMReconnect.java

示例4: createResourceManager

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
@Override
protected ResourceManager createResourceManager() {
  return new ResourceManager() {
    @Override
    protected void doSecureLogin() throws IOException {
      // Don't try to login using keytab in the testcases.
    }
    @Override
    protected ClientRMService createClientRMService() {
      if (overrideClientRMService) {
        return new CustomedClientRMService(this.rmContext, this.scheduler,
            this.rmAppManager, this.applicationACLsManager,
            this.queueACLsManager,
            this.rmContext.getRMDelegationTokenSecretManager());
      }
      return super.createClientRMService();
    }
    @Override
    protected ResourceTrackerService createResourceTrackerService() {
      if (overrideRTS) {
        return new CustomedResourceTrackerService(this.rmContext,
            this.nodesListManager, this.nmLivelinessMonitor,
            this.rmContext.getContainerTokenSecretManager(),
            this.rmContext.getNMTokenSecretManager());
      }
      return super.createResourceTrackerService();
    }
    @Override
    protected ApplicationMasterService createApplicationMasterService() {
      if (overrideApplicationMasterService) {
        return new CustomedApplicationMasterService(this.rmContext,
            this.scheduler);
      }
      return super.createApplicationMasterService();
    }
  };
}
 
开发者ID:naver,项目名称:hadoop,代码行数:38,代码来源:ProtocolHATestBase.java

示例5: registerNode

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
private void registerNode(ResourceManager rm, NodeId nodeId)
    throws YarnException, IOException {
  ResourceTrackerService resourceTrackerService =
      rm.getResourceTrackerService();
  RegisterNodeManagerRequest req =
      Records.newRecord(RegisterNodeManagerRequest.class);
  Resource capability = BuilderUtils.newResource(1024, 1);
  req.setResource(capability);
  req.setNodeId(nodeId);
  req.setHttpPort(1234);
  req.setNMVersion(YarnVersionInfo.getVersion());
  resourceTrackerService.registerNodeManager(req);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:14,代码来源:TestRMDelegatedNodeLabelsUpdater.java

示例6: setUp

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
@Before
public void setUp() {
  Configuration conf = new Configuration();
  // Dispatcher that processes events inline
  dispatcher = new InlineDispatcher();

  dispatcher.register(RMNodeEventType.class,
      new TestRMNodeEventDispatcher());

  context = new RMContextImpl(dispatcher, null,
      null, null, null, null, null, null, null, null);
  dispatcher.register(SchedulerEventType.class,
      new InlineDispatcher.EmptyEventHandler());
  dispatcher.register(RMNodeEventType.class,
      new NodeEventDispatcher(context));
  NMLivelinessMonitor nmLivelinessMonitor = new NMLivelinessMonitor(
      dispatcher);
  nmLivelinessMonitor.init(conf);
  nmLivelinessMonitor.start();
  NodesListManager nodesListManager = new NodesListManager(context);
  nodesListManager.init(conf);
  RMContainerTokenSecretManager containerTokenSecretManager =
      new RMContainerTokenSecretManager(conf);
  containerTokenSecretManager.start();
  NMTokenSecretManagerInRM nmTokenSecretManager =
      new NMTokenSecretManagerInRM(conf);
  nmTokenSecretManager.start();
  resourceTrackerService = new ResourceTrackerService(context,
      nodesListManager, nmLivelinessMonitor, containerTokenSecretManager,
      nmTokenSecretManager);
  
  resourceTrackerService.init(conf);
  resourceTrackerService.start();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:35,代码来源:TestNMReconnect.java

示例7: setUp

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
@Before
public void setUp() {
  Configuration conf = new Configuration();
  // Dispatcher that processes events inline
  Dispatcher dispatcher = new InlineDispatcher();
  dispatcher.register(SchedulerEventType.class, new EventHandler<Event>() {
    @Override
    public void handle(Event event) {
      ; // ignore
    }
  });
  RMContext context =
      new RMContextImpl(dispatcher, null, null, null, null,
        null, new RMContainerTokenSecretManager(conf),
        new NMTokenSecretManagerInRM(conf), null);
  dispatcher.register(RMNodeEventType.class,
      new ResourceManager.NodeEventDispatcher(context));
  NodesListManager nodesListManager = new NodesListManager(context);
  nodesListManager.init(conf);
  
  context.getContainerTokenSecretManager().rollMasterKey();
  context.getNMTokenSecretManager().rollMasterKey();
  resourceTrackerService = new ResourceTrackerService(context,
      nodesListManager, new NMLivelinessMonitor(dispatcher),
      context.getContainerTokenSecretManager(),
      context.getNMTokenSecretManager());
  resourceTrackerService.init(conf);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:29,代码来源:TestRMNMRPCResponseId.java

示例8: setUp

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
@Before
public void setUp() {
  Configuration conf = new Configuration();
  // Dispatcher that processes events inline
  Dispatcher dispatcher = new InlineDispatcher();
  RMContext context = new RMContextImpl(dispatcher, null,
      null, null, null, null, null, null, null);
  dispatcher.register(SchedulerEventType.class,
      new InlineDispatcher.EmptyEventHandler());
  dispatcher.register(RMNodeEventType.class,
      new NodeEventDispatcher(context));
  NMLivelinessMonitor nmLivelinessMonitor = new TestNmLivelinessMonitor(
      dispatcher);
  nmLivelinessMonitor.init(conf);
  nmLivelinessMonitor.start();
  NodesListManager nodesListManager = new NodesListManager(context);
  nodesListManager.init(conf);
  RMContainerTokenSecretManager containerTokenSecretManager =
      new RMContainerTokenSecretManager(conf);
  containerTokenSecretManager.start();
  NMTokenSecretManagerInRM nmTokenSecretManager =
      new NMTokenSecretManagerInRM(conf);
  nmTokenSecretManager.start();
  resourceTrackerService = new ResourceTrackerService(context,
      nodesListManager, nmLivelinessMonitor, containerTokenSecretManager,
      nmTokenSecretManager);
  
  resourceTrackerService.init(conf);
  resourceTrackerService.start();
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:31,代码来源:TestNMExpiry.java

示例9: setUp

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
@Before
public void setUp() throws IOException {
  Configuration conf = new Configuration();
  RMStorageFactory.setConfiguration(conf);
  YarnAPIStorageFactory.setConfiguration(conf);
  DBUtility.InitializeDB();
  // Dispatcher that processes events inline
  dispatcher = new InlineDispatcher();

  dispatcher.register(RMNodeEventType.class,
      new TestRMNodeEventDispatcher());

  context = new RMContextImpl(dispatcher, null,
      null, null, null, null, null, null, null, null);
  dispatcher.register(SchedulerEventType.class,
      new InlineDispatcher.EmptyEventHandler());
  dispatcher.register(RMNodeEventType.class,
      new NodeEventDispatcher(context));
  NMLivelinessMonitor nmLivelinessMonitor = new NMLivelinessMonitor(
      dispatcher);
  nmLivelinessMonitor.init(conf);
  nmLivelinessMonitor.start();
  NodesListManager nodesListManager = new NodesListManager(context);
  nodesListManager.init(conf);
  RMContainerTokenSecretManager containerTokenSecretManager =
      new RMContainerTokenSecretManager(conf);
  containerTokenSecretManager.start();
  NMTokenSecretManagerInRM nmTokenSecretManager =
      new NMTokenSecretManagerInRM(conf);
  nmTokenSecretManager.start();
  resourceTrackerService = new ResourceTrackerService(context,
      nodesListManager, nmLivelinessMonitor, containerTokenSecretManager,
      nmTokenSecretManager);
  
  resourceTrackerService.init(conf);
  resourceTrackerService.start();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:38,代码来源:TestNMReconnect.java

示例10: getPrivateResourceTrackerService

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
private ResourceTrackerService getPrivateResourceTrackerService(
    Dispatcher privateDispatcher, ResourceManager rm,
    SleepHandler sleepHandler) {
  Configuration conf = getConf();

  RMContext privateContext =
      new RMContextImpl(privateDispatcher, null, null, null, null, null, null,
          null, null, null);
  privateContext.setNodeLabelManager(Mockito.mock(RMNodeLabelsManager.class));

  privateDispatcher.register(SchedulerEventType.class, sleepHandler);
  privateDispatcher.register(SchedulerEventType.class,
      rm.getResourceScheduler());
  privateDispatcher.register(RMNodeEventType.class,
      new ResourceManager.NodeEventDispatcher(privateContext));
  ((Service) privateDispatcher).init(conf);
  ((Service) privateDispatcher).start();
  NMLivelinessMonitor nmLivelinessMonitor =
      new NMLivelinessMonitor(privateDispatcher);
  nmLivelinessMonitor.init(conf);
  nmLivelinessMonitor.start();
  NodesListManager nodesListManager = new NodesListManager(privateContext);
  nodesListManager.init(conf);
  RMContainerTokenSecretManager containerTokenSecretManager =
      new RMContainerTokenSecretManager(conf);
  containerTokenSecretManager.start();
  NMTokenSecretManagerInRM nmTokenSecretManager =
      new NMTokenSecretManagerInRM(conf);
  nmTokenSecretManager.start();
  ResourceTrackerService privateResourceTrackerService =
      new ResourceTrackerService(privateContext, nodesListManager,
          nmLivelinessMonitor, containerTokenSecretManager,
          nmTokenSecretManager);
  privateResourceTrackerService.init(conf);
  privateResourceTrackerService.start();
  rm.getResourceScheduler().setRMContext(privateContext);
  return privateResourceTrackerService;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:39,代码来源:TestAbstractYarnScheduler.java

示例11: testNodemanagerReconnect

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
/**
 * Test the behaviour of the capacity scheduler when a node reconnects
 * with changed capabilities. This test is to catch any race conditions
 * that might occur due to the use of the RMNode object.
 * @throws Exception
 */
@Test
public void testNodemanagerReconnect() throws Exception {

  DrainDispatcher privateDispatcher = new DrainDispatcher();
  SleepHandler sleepHandler = new SleepHandler();
  ResourceTrackerService privateResourceTrackerService =
      getPrivateResourceTrackerService(privateDispatcher,
          sleepHandler);

  // Register node1
  String hostname1 = "localhost1";
  Resource capability = BuilderUtils.newResource(4096, 4);
  RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);

  RegisterNodeManagerRequest request1 =
      recordFactory.newRecordInstance(RegisterNodeManagerRequest.class);
  NodeId nodeId1 = NodeId.newInstance(hostname1, 0);
  request1.setNodeId(nodeId1);
  request1.setHttpPort(0);
  request1.setResource(capability);
  privateResourceTrackerService.registerNodeManager(request1);
  privateDispatcher.await();
  Resource clusterResource = resourceManager.getResourceScheduler().getClusterResource();
  Assert.assertEquals("Initial cluster resources don't match", capability,
      clusterResource);

  Resource newCapability = BuilderUtils.newResource(1024, 1);
  RegisterNodeManagerRequest request2 =
      recordFactory.newRecordInstance(RegisterNodeManagerRequest.class);
  request2.setNodeId(nodeId1);
  request2.setHttpPort(0);
  request2.setResource(newCapability);
  // hold up the disaptcher and register the same node with lower capability
  sleepHandler.sleepFlag = true;
  privateResourceTrackerService.registerNodeManager(request2);
  privateDispatcher.await();
  Assert.assertEquals("Cluster resources don't match", newCapability,
      resourceManager.getResourceScheduler().getClusterResource());
  privateResourceTrackerService.stop();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:47,代码来源:TestCapacityScheduler.java

示例12: testNodemanagerReconnect

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
/**
 * Test the behavior of the scheduler when a node reconnects
 * with changed capabilities. This test is to catch any race conditions
 * that might occur due to the use of the RMNode object.
 * @throws Exception
 */
@Test(timeout = 60000)
public void testNodemanagerReconnect() throws Exception {
  configureScheduler();
  Configuration conf = getConf();
  MockRM rm = new MockRM(conf);
  try {
    rm.start();

    conf.setBoolean(Dispatcher.DISPATCHER_EXIT_ON_ERROR_KEY, false);
    DrainDispatcher privateDispatcher = new DrainDispatcher();
    SleepHandler sleepHandler = new SleepHandler();
    ResourceTrackerService privateResourceTrackerService =
        getPrivateResourceTrackerService(privateDispatcher, rm, sleepHandler);

    // Register node1
    String hostname1 = "localhost1";
    Resource capability = BuilderUtils.newResource(4096, 4);
    RecordFactory recordFactory =
        RecordFactoryProvider.getRecordFactory(null);

    RegisterNodeManagerRequest request1 =
        recordFactory.newRecordInstance(RegisterNodeManagerRequest.class);
    NodeId nodeId1 = NodeId.newInstance(hostname1, 0);
    request1.setNodeId(nodeId1);
    request1.setHttpPort(0);
    request1.setResource(capability);
    privateResourceTrackerService.registerNodeManager(request1);
    privateDispatcher.await();
    Resource clusterResource =
        rm.getResourceScheduler().getClusterResource();
    Assert.assertEquals("Initial cluster resources don't match", capability,
        clusterResource);

    Resource newCapability = BuilderUtils.newResource(1024, 1);
    RegisterNodeManagerRequest request2 =
        recordFactory.newRecordInstance(RegisterNodeManagerRequest.class);
    request2.setNodeId(nodeId1);
    request2.setHttpPort(0);
    request2.setResource(newCapability);
    // hold up the disaptcher and register the same node with lower capability
    sleepHandler.sleepFlag = true;
    privateResourceTrackerService.registerNodeManager(request2);
    privateDispatcher.await();
    Assert.assertEquals("Cluster resources don't match", newCapability,
        rm.getResourceScheduler().getClusterResource());
    privateResourceTrackerService.stop();
  } finally {
    rm.stop();
  }
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:57,代码来源:TestAbstractYarnScheduler.java

示例13: setResourceTrackerService

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
public void setResourceTrackerService(ResourceTrackerService resourceTrackerService) {
  this.resourceTrackerService = resourceTrackerService;
}
 
开发者ID:apache,项目名称:incubator-myriad,代码行数:4,代码来源:MockRMContext.java

示例14: getResourceTrackerService

import org.apache.hadoop.yarn.server.resourcemanager.ResourceTrackerService; //导入依赖的package包/类
@Override
public ResourceTrackerService getResourceTrackerService() {
  return resourceTrackerService;
}
 
开发者ID:apache,项目名称:incubator-myriad,代码行数:5,代码来源:MockRMContext.java


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