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


Java ResourceTracker类代码示例

本文整理汇总了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;未经允许,请勿转载。