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


Java NodeHeartbeatRequest.newInstance方法代码示例

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


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

示例1: testResourceTrackerOnHA

import org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest; //导入方法依赖的package包/类
@Test(timeout = 15000)
public void testResourceTrackerOnHA() throws Exception {
  NodeId nodeId = NodeId.newInstance("localhost", 0);
  Resource resource = Resource.newInstance(2048, 4, 4);

  // make sure registerNodeManager works when failover happens
  RegisterNodeManagerRequest request =
      RegisterNodeManagerRequest.newInstance(nodeId, 0, resource,
          YarnVersionInfo.getVersion(), null, null);
  resourceTracker.registerNodeManager(request);
  Assert.assertTrue(waitForNodeManagerToConnect(10000, nodeId));

  // restart the failover thread, and make sure nodeHeartbeat works
  failoverThread = createAndStartFailoverThread();
  NodeStatus status =
      NodeStatus.newInstance(NodeId.newInstance("localhost", 0), 0, null,
          null, null);
  NodeHeartbeatRequest request2 =
      NodeHeartbeatRequest.newInstance(status, null, null);
  resourceTracker.nodeHeartbeat(request2);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:TestResourceTrackerOnHA.java

示例2: testResourceTrackerOnHA

import org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest; //导入方法依赖的package包/类
@Test(timeout = 15000)
public void testResourceTrackerOnHA() throws Exception {
  NodeId nodeId = NodeId.newInstance("localhost", 0);
  Resource resource = Resource.newInstance(2048, 4);

  // make sure registerNodeManager works when failover happens
  RegisterNodeManagerRequest request =
      RegisterNodeManagerRequest.newInstance(nodeId, 0, resource,
          YarnVersionInfo.getVersion(), null, null);
  resourceTracker.registerNodeManager(request);
  Assert.assertTrue(waitForNodeManagerToConnect(10000, nodeId));

  // restart the failover thread, and make sure nodeHeartbeat works
  failoverThread = createAndStartFailoverThread();
  NodeStatus status =
      NodeStatus.newInstance(NodeId.newInstance("localhost", 0), 0, null,
          null, null, null, null, null);
  NodeHeartbeatRequest request2 =
      NodeHeartbeatRequest.newInstance(status, null, null,null);
  resourceTracker.nodeHeartbeat(request2);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:22,代码来源:TestResourceTrackerOnHA.java

示例3: testResourceTrackerOnHA

import org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest; //导入方法依赖的package包/类
@Test(timeout = 15000)
public void testResourceTrackerOnHA() throws Exception {
  NodeId nodeId = NodeId.newInstance("localhost", 0);
  Resource resource = Resource.newInstance(2048, 4);

  // make sure registerNodeManager works when failover happens
  RegisterNodeManagerRequest request =
      RegisterNodeManagerRequest.newInstance(nodeId, 0, resource,
          YarnVersionInfo.getVersion(), null, null);
  resourceTracker.registerNodeManager(request);
  Assert.assertTrue(waitForNodeManagerToConnect(10000, nodeId));

  // restart the failover thread, and make sure nodeHeartbeat works
  failoverThread = createAndStartFailoverThread();
  NodeStatus status =
      NodeStatus.newInstance(NodeId.newInstance("localhost", 0), 0, null,
          null, null);
  NodeHeartbeatRequest request2 =
      NodeHeartbeatRequest.newInstance(status, null, null);
  resourceTracker.nodeHeartbeat(request2);
}
 
开发者ID:yncxcw,项目名称:big-c,代码行数:22,代码来源:TestResourceTrackerOnHA.java

示例4: testResourceTrackerOnHA

import org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest; //导入方法依赖的package包/类
@Test(timeout = 15000)
public void testResourceTrackerOnHA() throws Exception {
  NodeId nodeId = NodeId.newInstance("localhost", 0);
  Resource resource = Resource.newInstance(2048, 4);

  // make sure registerNodeManager works when failover happens
  RegisterNodeManagerRequest request =
      RegisterNodeManagerRequest.newInstance(nodeId, 0, resource,
          YarnVersionInfo.getVersion(), null);
  resourceTracker.registerNodeManager(request);
  Assert.assertTrue(waitForNodeManagerToConnect(10000, nodeId));

  // restart the failover thread, and make sure nodeHeartbeat works
  failoverThread = createAndStartFailoverThread();
  NodeStatus status =
      NodeStatus.newInstance(NodeId.newInstance("localhost", 0), 0, null,
          null, null);
  NodeHeartbeatRequest request2 =
      NodeHeartbeatRequest.newInstance(status, null, null);
  resourceTracker.nodeHeartbeat(request2);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:22,代码来源:TestResourceTrackerOnHA.java

示例5: testUpdateNodeUtilization

import org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest; //导入方法依赖的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

示例6: testUpdateNodeUtilization

import org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatRequest; //导入方法依赖的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


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