• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ResourceTracker类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testPbServerFactory

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
private void testPbServerFactory() {
  InetSocketAddress addr = new InetSocketAddress(0);
  Configuration conf = new Configuration();
  ResourceTracker instance = new ResourceTrackerTestImpl();
  Server server = null;
  try {
    server = 
      RpcServerFactoryPBImpl.get().getServer(
          ResourceTracker.class, instance, addr, conf, null, 1);
    server.start();
  } catch (YarnRuntimeException e) {
    e.printStackTrace();
    Assert.fail("Failed to create server");
  } finally {
    server.stop();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestYSCRPCFactories.java


示例2: serviceStart

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@Override
protected void serviceStart() throws Exception {
  super.serviceStart();
  // ResourceTrackerServer authenticates NodeManager via Kerberos if
  // security is enabled, so no secretManager.
  Configuration conf = getConfig();
  YarnRPC rpc = YarnRPC.create(conf);
  this.server =
    rpc.getServer(ResourceTracker.class, this, resourceTrackerAddress,
        conf, null,
        conf.getInt(YarnConfiguration.RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT, 
            YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT));
  
  // Enable service authorization?
  if (conf.getBoolean(
      CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, 
      false)) {
    refreshServiceAcls(conf, new RMPolicyProvider());
  }

  this.server.start();
  conf.updateConnectAddr(YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS,
                         server.getListenerAddress());
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:25,代码来源:ResourceTrackerService.java


示例3: start

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@BeforeClass
public static void start() {
  InetSocketAddress address = new InetSocketAddress(0);
  Configuration configuration = new Configuration();
  ResourceTracker instance = new ResourceTrackerTestImpl();
  server = RpcServerFactoryPBImpl.get().getServer(ResourceTracker.class,
      instance, address, configuration, null, 1);
  server.start();

  client = (ResourceTracker) RpcClientFactoryPBImpl.get().getClient(
      ResourceTracker.class, 1, NetUtils.getConnectAddress(server),
      configuration);

}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestResourceTrackerPBClientImpl.java


示例4: getRMClient

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@Override
protected ResourceTracker getRMClient() throws IOException {
  RetryPolicy retryPolicy = RMProxy.createRetryPolicy(conf);
  resourceTracker =
      (ResourceTracker) RetryProxy.create(ResourceTracker.class,
        new MyResourceTracker6(rmStartIntervalMS, rmNeverStart),
        retryPolicy);
  return resourceTracker;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:TestNodeStatusUpdater.java


示例5: serviceStart

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@Override
protected void serviceStart() throws Exception {
  super.serviceStart();
  // ResourceTrackerServer authenticates NodeManager via Kerberos if
  // security is enabled, so no secretManager.
  Configuration conf = getConfig();
  YarnRPC rpc = YarnRPC.create(conf);
  this.server =
    rpc.getServer(ResourceTracker.class, this, resourceTrackerAddress,
        conf, null,
        conf.getInt(YarnConfiguration.RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT, 
            YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT));
  
  // Enable service authorization?
  if (conf.getBoolean(
      CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, 
      false)) {
    InputStream inputStream =
        this.rmContext.getConfigurationProvider()
            .getConfigurationInputStream(conf,
                YarnConfiguration.HADOOP_POLICY_CONFIGURATION_FILE);
    if (inputStream != null) {
      conf.addResource(inputStream);
    }
    refreshServiceAcls(conf, RMPolicyProvider.getInstance());
  }
 
  this.server.start();
  conf.updateConnectAddr(YarnConfiguration.RM_BIND_HOST,
	   YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS,
	   YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS,
                         server.getListenerAddress());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:ResourceTrackerService.java


示例6: testUpdateNodeUtilization

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
/**
 * Simulates a NM heartbeat using the simulated NodeStatus fixture. Verify
 * both the RMNode and SchedulerNode have been updated with the new
 * utilization.
 */
@Test(timeout=60000)
public void testUpdateNodeUtilization()
    throws InterruptedException, IOException, YarnException {
  assertTrue("NMs fail to connect to the RM",
      cluster.waitForNodeManagersToConnect(10000));

  // Simulate heartbeat using NodeStatus fixture
  NodeHeartbeatRequest request =
      NodeHeartbeatRequest.newInstance(nodeStatus, null, null, null);
  ResourceTracker tracker =
      ServerRMProxy.createRMProxy(conf, ResourceTracker.class);
  tracker.nodeHeartbeat(request);

  // Give the heartbeat time to propagate to the RM
  verifySimulatedUtilization();

  // Alter utilization
  int responseId = 10;
  nodeStatus = createNodeStatus(nm.getNMContext().getNodeId(), responseId,
      CONTAINER_PMEM_2, CONTAINER_VMEM_2, CONTAINER_CPU_2,
      NODE_PMEM_2, NODE_VMEM_2, NODE_CPU_2);
  nm.setNodeStatus(nodeStatus);
  tracker.nodeHeartbeat(request);

  // Give the heartbeat time to propagate to the RM
  verifySimulatedUtilization();
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:33,代码来源:TestMiniYarnClusterNodeUtilization.java


示例7: getRMClient

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@Override
protected ResourceTracker getRMClient() throws IOException {
  RetryPolicy retryPolicy = RMProxy.createRetryPolicy(conf);
  resourceTracker =
      (ResourceTracker) RetryProxy.create(ResourceTracker.class,
        new MyResourceTracker6(this.context, rmStartIntervalMS,
          rmNeverStart), retryPolicy);
  return resourceTracker;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:10,代码来源:TestNodeStatusUpdater.java


示例8: testUpdateNodeUtilization

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
/**
 * Simulates a NM heartbeat using the simulated NodeStatus fixture. Verify
 * both the RMNode and SchedulerNode have been updated with the new
 * utilization.
 */
@Test(timeout=60000)
public void testUpdateNodeUtilization()
    throws InterruptedException, IOException, YarnException {
  assertTrue("NMs fail to connect to the RM",
      cluster.waitForNodeManagersToConnect(10000));

  // Simulate heartbeat using NodeStatus fixture
  NodeHeartbeatRequest request =
      NodeHeartbeatRequest.newInstance(nodeStatus, null, null, null);
  ResourceTracker tracker =
      ServerRMProxy.createRMProxy(conf, ResourceTracker.class, true);
  tracker.nodeHeartbeat(request);

  // Give the heartbeat time to propagate to the RM
  verifySimulatedUtilization();

  // Alter utilization
  int responseId = 10;
  nodeStatus = createNodeStatus(nm.getNMContext().getNodeId(), responseId,
      CONTAINER_PMEM_2, CONTAINER_VMEM_2, CONTAINER_CPU_2,
      NODE_PMEM_2, NODE_VMEM_2, NODE_CPU_2);
  nm.setNodeStatus(nodeStatus);
  tracker.nodeHeartbeat(request);

  // Give the heartbeat time to propagate to the RM
  verifySimulatedUtilization();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:33,代码来源:TestMiniYarnClusterNodeUtilization.java


示例9: getRMClient

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@VisibleForTesting
protected ResourceTracker getRMClient() throws IOException {
  Configuration conf = getConfig();
  return ServerRMProxy.createRMProxy(conf, ResourceTracker.class, 
          conf.getBoolean(YarnConfiguration.DISTRIBUTED_RM,
          YarnConfiguration.DEFAULT_DISTRIBUTED_RM));
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:8,代码来源:NodeStatusUpdaterImpl.java


示例10: serviceStart

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@Override
protected void serviceStart() throws Exception {
  super.serviceStart();
  // ResourceTrackerServer authenticates NodeManager via Kerberos if
  // security is enabled, so no secretManager.
  Configuration conf = getConfig();
  YarnRPC rpc = YarnRPC.create(conf);
  this.server = rpc.getServer(
      ResourceTracker.class, this, resourceTrackerAddress, conf, null,
      conf.getInt(YarnConfiguration.RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT,
          YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT));

  // Enable service authorization?
  if (conf.getBoolean(
      CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,
      false)) {
    InputStream inputStream =
        this.rmContext.getConfigurationProvider()
            .getConfigurationInputStream(conf,
                YarnConfiguration.HADOOP_POLICY_CONFIGURATION_FILE);
    if (inputStream != null) {
      conf.addResource(inputStream);
    }
    refreshServiceAcls(conf, RMPolicyProvider.getInstance());
  }

  this.server.start();
  conf.updateConnectAddr(YarnConfiguration.RM_BIND_HOST,
      YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS,
      YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_ADDRESS,
      server.getListenerAddress());
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:33,代码来源:ResourceTrackerService.java


示例11: serviceStart

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@Override
protected void serviceStart() throws Exception {
  super.serviceStart();
  // ResourceTrackerServer authenticates NodeManager via Kerberos if
  // security is enabled, so no secretManager.
  Configuration conf = getConfig();
  YarnRPC rpc = YarnRPC.create(conf);
  this.server =
    rpc.getServer(ResourceTracker.class, this, resourceTrackerAddress,
        conf, null,
        conf.getInt(YarnConfiguration.RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT, 
            YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_CLIENT_THREAD_COUNT));
  
  // Enable service authorization?
  if (conf.getBoolean(
      CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION, 
      false)) {
    InputStream inputStream =
        this.rmContext.getConfigurationProvider()
            .getConfigurationInputStream(conf,
                YarnConfiguration.HADOOP_POLICY_CONFIGURATION_FILE);
    if (inputStream != null) {
      conf.addResource(inputStream);
    }
    refreshServiceAcls(conf, RMPolicyProvider.getInstance());
  }

  this.server.start();
  conf.updateConnectAddr(YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS,
                         server.getListenerAddress());
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:32,代码来源:ResourceTrackerService.java


示例12: ResourceTrackerPBServiceImpl

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
public ResourceTrackerPBServiceImpl(ResourceTracker impl) {
  this.real = impl;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:ResourceTrackerPBServiceImpl.java


示例13: getRMClient

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@VisibleForTesting
protected ResourceTracker getRMClient() throws IOException {
  Configuration conf = getConfig();
  return ServerRMProxy.createRMProxy(conf, ResourceTracker.class);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:NodeStatusUpdaterImpl.java


示例14: getRMClient

import org.apache.hadoop.yarn.server.api.ResourceTracker; //导入依赖的package包/类
@Override
protected ResourceTracker getRMClient() {
  return new LocalRMInterface();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:BaseContainerManagerTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TCharObjectMap类代码示例发布时间:2022-05-22
下一篇:
Java Prober类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap