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


Java NodeStatus类代码示例

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


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

示例1: getNodeStatus

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
private NodeStatus getNodeStatus() {
  NodeStatus status = recordFactory.newRecordInstance(NodeStatus.class);
  status.setContainersStatuses(new ArrayList<ContainerStatus>());
  status.setKeepAliveApplications(new ArrayList<ApplicationId>());

  status.setNodeHealthStatus(getNodeHealthStatus());
  status.setNodeId(getNodeId());
  status.setResponseId(1);
  return status;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:TestYarnServerApiClasses.java

示例2: getNodeStatus

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
private NodeStatus getNodeStatus(int responseId) throws IOException {

    NodeHealthStatus nodeHealthStatus = this.context.getNodeHealthStatus();
    nodeHealthStatus.setHealthReport(healthChecker.getHealthReport());
    nodeHealthStatus.setIsNodeHealthy(healthChecker.isHealthy());
    nodeHealthStatus.setLastHealthReportTime(healthChecker
      .getLastHealthReportTime());
    if (LOG.isDebugEnabled()) {
      LOG.debug("Node's health-status : " + nodeHealthStatus.getIsNodeHealthy()
          + ", " + nodeHealthStatus.getHealthReport());
    }
    List<ContainerStatus> containersStatuses = getContainerStatuses();
    NodeStatus nodeStatus =
        NodeStatus.newInstance(nodeId, responseId, containersStatuses,
          createKeepAliveApplicationList(), nodeHealthStatus);

    return nodeStatus;
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:NodeStatusUpdaterImpl.java

示例3: testResourceTrackerOnHA

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的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

示例4: getNodeStatus

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
@VisibleForTesting
protected NodeStatus getNodeStatus(int responseId) throws IOException {

  NodeHealthStatus nodeHealthStatus = this.context.getNodeHealthStatus();
  nodeHealthStatus.setHealthReport(healthChecker.getHealthReport());
  nodeHealthStatus.setIsNodeHealthy(healthChecker.isHealthy());
  nodeHealthStatus.setLastHealthReportTime(healthChecker
    .getLastHealthReportTime());
  if (LOG.isDebugEnabled()) {
    LOG.debug("Node's health-status : " + nodeHealthStatus.getIsNodeHealthy()
        + ", " + nodeHealthStatus.getHealthReport());
  }
  List<ContainerStatus> containersStatuses = getContainerStatuses();
  ResourceUtilization containersUtilization = getContainersUtilization();
  ResourceUtilization nodeUtilization = getNodeUtilization();
  List<org.apache.hadoop.yarn.api.records.Container> increasedContainers
      = getIncreasedContainers();
  NodeStatus nodeStatus =
      NodeStatus.newInstance(nodeId, responseId, containersStatuses,
        createKeepAliveApplicationList(), nodeHealthStatus,
        containersUtilization, nodeUtilization, increasedContainers);

  return nodeStatus;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:25,代码来源:NodeStatusUpdaterImpl.java

示例5: nodeHeartbeat

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
@Override
public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request)
    throws YarnException, IOException {
  System.out.println("RTS receive heartbeat : "
      + System.currentTimeMillis());
  labels = request.getNodeLabels();
  NodeStatus nodeStatus = request.getNodeStatus();
  nodeStatus.setResponseId(heartbeatID++);

  NodeHeartbeatResponse nhResponse =
      YarnServerBuilderUtils.newNodeHeartbeatResponse(heartbeatID,
          NodeAction.NORMAL, null, null, null, null, 1000L);

  // to ensure that heartbeats are sent only when required.
  nhResponse.setNextHeartBeatInterval(Long.MAX_VALUE);
  nhResponse.setAreNodeLabelsAcceptedByRM(labels != null);

  synchronized (ResourceTrackerForLabels.class) {
    receivedNMHeartbeat = true;
    ResourceTrackerForLabels.class.notifyAll();
  }
  return nhResponse;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:24,代码来源:TestNodeStatusUpdaterForLabels.java

示例6: testResourceTrackerOnHA

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的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

示例7: testResourceTrackerOnHA

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的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

示例8: getNodeStatus

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
private NodeStatus getNodeStatus(int responseId) {

    NodeHealthStatus nodeHealthStatus = this.context.getNodeHealthStatus();
    nodeHealthStatus.setHealthReport(healthChecker.getHealthReport());
    nodeHealthStatus.setIsNodeHealthy(healthChecker.isHealthy());
    nodeHealthStatus.setLastHealthReportTime(healthChecker
      .getLastHealthReportTime());
    if (LOG.isDebugEnabled()) {
      LOG.debug("Node's health-status : " + nodeHealthStatus.getIsNodeHealthy()
          + ", " + nodeHealthStatus.getHealthReport());
    }
    List<ContainerStatus> containersStatuses = getContainerStatuses();
    if (LOG.isDebugEnabled()) {
      LOG.debug(this.nodeId + " sending out status for "
          + containersStatuses.size() + " containers");
    }
    NodeStatus nodeStatus =
        NodeStatus.newInstance(nodeId, responseId, containersStatuses,
          createKeepAliveApplicationList(), nodeHealthStatus);

    return nodeStatus;
  }
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:23,代码来源:NodeStatusUpdaterImpl.java

示例9: testResourceTrackerOnHA

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的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

示例10: newInstance

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
public static NodeHeartbeatRequest newInstance(NodeStatus nodeStatus,
    MasterKey lastKnownContainerTokenMasterKey,
    MasterKey lastKnownNMTokenMasterKey) {
  NodeHeartbeatRequest nodeHeartbeatRequest =
      Records.newRecord(NodeHeartbeatRequest.class);
  nodeHeartbeatRequest.setNodeStatus(nodeStatus);
  nodeHeartbeatRequest
      .setLastKnownContainerTokenMasterKey(lastKnownContainerTokenMasterKey);
  nodeHeartbeatRequest
      .setLastKnownNMTokenMasterKey(lastKnownNMTokenMasterKey);
  return nodeHeartbeatRequest;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:NodeHeartbeatRequest.java

示例11: getNodeStatus

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
@Override
public NodeStatus getNodeStatus() {
  NodeHeartbeatRequestProtoOrBuilder p = viaProto ? proto : builder;
  if (this.nodeStatus != null) {
    return this.nodeStatus;
  }
  if (!p.hasNodeStatus()) {
    return null;
  }
  this.nodeStatus = convertFromProtoFormat(p.getNodeStatus());
  return this.nodeStatus;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:NodeHeartbeatRequestPBImpl.java

示例12: setNodeStatus

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
@Override
public void setNodeStatus(NodeStatus nodeStatus) {
  maybeInitBuilder();
  if (nodeStatus == null) 
    builder.clearNodeStatus();
  this.nodeStatus = nodeStatus;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:NodeHeartbeatRequestPBImpl.java

示例13: nodeHeartbeat

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
@Override
public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request)
    throws YarnException, IOException {
  NodeStatus nodeStatus = request.getNodeStatus();
  nodeStatus.setResponseId(heartBeatID++);

  NodeHeartbeatResponse nhResponse = YarnServerBuilderUtils.
      newNodeHeartbeatResponse(heartBeatID, heartBeatNodeAction, null,
          null, null, null, 1000L);
  nhResponse.setDiagnosticsMessage(shutDownMessage);
  return nhResponse;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:TestNodeStatusUpdater.java

示例14: nodeHeartbeat

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
@Override
public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request)
    throws YarnException, IOException {
  NodeStatus nodeStatus = request.getNodeStatus();
  LOG.info("Got heartbeat number " + heartBeatID);
  nodeStatus.setResponseId(heartBeatID++);

  NodeHeartbeatResponse nhResponse = YarnServerBuilderUtils
      .newNodeHeartbeatResponse(heartBeatID, null, null,
          null, null, null, 1000L);
  return nhResponse;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:MockNodeStatusUpdater.java

示例15: heartbeat

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
public void heartbeat() throws IOException, YarnException {
  NodeStatus nodeStatus = 
    org.apache.hadoop.yarn.server.resourcemanager.NodeManager.createNodeStatus(
        nodeId, getContainerStatuses(containers));
  nodeStatus.setResponseId(responseID);
  NodeHeartbeatRequest request = recordFactory
      .newRecordInstance(NodeHeartbeatRequest.class);
  request.setNodeStatus(nodeStatus);
  NodeHeartbeatResponse response = resourceTrackerService
      .nodeHeartbeat(request);
  responseID = response.getResponseId();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:NodeManager.java


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