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

Java NodeStatus类代码示例

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

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



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


示例16: createNodeStatus

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
public static org.apache.hadoop.yarn.server.api.records.NodeStatus 
createNodeStatus(NodeId nodeId, List<ContainerStatus> containers) {
  RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
  org.apache.hadoop.yarn.server.api.records.NodeStatus nodeStatus = 
      recordFactory.newRecordInstance(org.apache.hadoop.yarn.server.api.records.NodeStatus.class);
  nodeStatus.setNodeId(nodeId);
  nodeStatus.setContainersStatuses(containers);
  NodeHealthStatus nodeHealthStatus = 
    recordFactory.newRecordInstance(NodeHealthStatus.class);
  nodeHealthStatus.setIsNodeHealthy(true);
  nodeStatus.setNodeHealthStatus(nodeHealthStatus);
  return nodeStatus;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:NodeManager.java


示例17: nodeHeartbeat

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
public NodeHeartbeatResponse nodeHeartbeat(Map<ApplicationId,
    List<ContainerStatus>> conts, boolean isHealthy, int resId) throws Exception {
  NodeHeartbeatRequest req = Records.newRecord(NodeHeartbeatRequest.class);
  NodeStatus status = Records.newRecord(NodeStatus.class);
  status.setResponseId(resId);
  status.setNodeId(nodeId);
  for (Map.Entry<ApplicationId, List<ContainerStatus>> entry : conts.entrySet()) {
    Log.info("entry.getValue() " + entry.getValue());
    status.setContainersStatuses(entry.getValue());
  }
  NodeHealthStatus healthStatus = Records.newRecord(NodeHealthStatus.class);
  healthStatus.setHealthReport("");
  healthStatus.setIsNodeHealthy(isHealthy);
  healthStatus.setLastHealthReportTime(1);
  status.setNodeHealthStatus(healthStatus);
  req.setNodeStatus(status);
  req.setLastKnownContainerTokenMasterKey(this.currentContainerTokenMasterKey);
  req.setLastKnownNMTokenMasterKey(this.currentNMTokenMasterKey);
  NodeHeartbeatResponse heartbeatResponse =
      resourceTracker.nodeHeartbeat(req);
  
  MasterKey masterKeyFromRM = heartbeatResponse.getContainerTokenMasterKey();
  if (masterKeyFromRM != null
      && masterKeyFromRM.getKeyId() != this.currentContainerTokenMasterKey
          .getKeyId()) {
    this.currentContainerTokenMasterKey = masterKeyFromRM;
  }

  masterKeyFromRM = heartbeatResponse.getNMTokenMasterKey();
  if (masterKeyFromRM != null
      && masterKeyFromRM.getKeyId() != this.currentNMTokenMasterKey
          .getKeyId()) {
    this.currentNMTokenMasterKey = masterKeyFromRM;
  }
  
  return heartbeatResponse;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:38,代码来源:MockNM.java


示例18: newInstance

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


示例19: getSimulatedNodeStatus

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
/**
 * Hook to allow modification/replacement of NodeStatus
 * @param currentStatus Current status.
 * @return New node status.
 */
protected NodeStatus getSimulatedNodeStatus(NodeStatus currentStatus) {
  if(nodeStatus == null) {
    return currentStatus;
  } else {
    // Increment response ID, the RMNodeStatusEvent will not get recorded
    // for a duplicate heartbeat
    nodeStatus.setResponseId(nodeStatus.getResponseId() + 1);
    return nodeStatus;
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:16,代码来源:MiniYARNCluster.java


示例20: createNodeStatusUpdater

import org.apache.hadoop.yarn.server.api.records.NodeStatus; //导入依赖的package包/类
@Override
protected NodeStatusUpdater createNodeStatusUpdater(Context context,
    Dispatcher dispatcher, NodeHealthCheckerService healthChecker) {
  return new NodeStatusUpdaterImpl(context,
      dispatcher,
      healthChecker,
      metrics) {

    // Allow simulation of nodestatus
    @Override
    protected NodeStatus getNodeStatus(int responseId) throws IOException {
      return getSimulatedNodeStatus(super.getNodeStatus(responseId));
    }
  };
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:16,代码来源:MiniYARNCluster.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ModelMagmaCube类代码示例发布时间:2022-05-22
下一篇:
Java JavaConstants类代码示例发布时间: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