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


Java NodeState.RUNNING属性代码示例

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


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

示例1: transition

@Override
public NodeState transition(RMNodeImpl rmNode, RMNodeEvent event) {
  RMNodeStatusEvent statusEvent = (RMNodeStatusEvent) event;

  // Switch the last heartbeatresponse.
  rmNode.latestNodeHeartBeatResponse = statusEvent.getLatestResponse();
  NodeHealthStatus remoteNodeHealthStatus = statusEvent.getNodeHealthStatus();
  rmNode.setHealthReport(remoteNodeHealthStatus.getHealthReport());
  rmNode.setLastHealthReportTime(
      remoteNodeHealthStatus.getLastHealthReportTime());
  if (remoteNodeHealthStatus.getIsNodeHealthy()) {
    rmNode.context.getDispatcher().getEventHandler().handle(
        new NodeAddedSchedulerEvent(rmNode));
    rmNode.context.getDispatcher().getEventHandler().handle(
            new NodesListManagerEvent(
                NodesListManagerEventType.NODE_USABLE, rmNode));
    // ??? how about updating metrics before notifying to ensure that
    // notifiers get update metadata because they will very likely query it
    // upon notification
    // Update metrics
    rmNode.updateMetricsForRejoinedNode(NodeState.UNHEALTHY);
    return NodeState.RUNNING;
  }

  return NodeState.UNHEALTHY;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:RMNodeImpl.java

示例2: waitForNodesRunning

private void waitForNodesRunning() throws InterruptedException {
  long startTimeMS = System.currentTimeMillis();
  while (true) {
    int numRunningNodes = 0;
    for (RMNode node : rm.getRMContext().getRMNodes().values()) {
      if (node.getState() == NodeState.RUNNING) {
        numRunningNodes ++;
      }
    }
    if (numRunningNodes == numNMs) {
      break;
    }
    LOG.info(MessageFormat.format("SLSRunner is waiting for all " +
            "nodes RUNNING. {0} of {1} NMs initialized.",
            numRunningNodes, numNMs));
    Thread.sleep(1000);
  }
  LOG.info(MessageFormat.format("SLSRunner takes {0} ms to launch all nodes.",
          (System.currentTimeMillis() - startTimeMS)));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:SLSRunner.java

示例3: transition

@Override
public NodeState transition(RMNodeImpl rmNode, RMNodeEvent event) {
  RMNodeStatusEvent statusEvent = (RMNodeStatusEvent)event;

  // Switch the last heartbeatresponse.
  rmNode.latestNodeHeartBeatResponse = statusEvent.getLatestResponse();
  NodeHealthStatus remoteNodeHealthStatus =
      statusEvent.getNodeHealthStatus();
  rmNode.setHealthReport(remoteNodeHealthStatus.getHealthReport());
  rmNode.setLastHealthReportTime(
      remoteNodeHealthStatus.getLastHealthReportTime());
  rmNode.setAggregatedContainersUtilization(
      statusEvent.getAggregatedContainersUtilization());
  rmNode.setNodeUtilization(statusEvent.getNodeUtilization());
  if (remoteNodeHealthStatus.getIsNodeHealthy()) {
    rmNode.context.getDispatcher().getEventHandler().handle(
        new NodeAddedSchedulerEvent(rmNode));
    rmNode.context.getDispatcher().getEventHandler().handle(
            new NodesListManagerEvent(
                NodesListManagerEventType.NODE_USABLE, rmNode));
    // ??? how about updating metrics before notifying to ensure that
    // notifiers get update metadata because they will very likely query it
    // upon notification
    // Update metrics
    rmNode.updateMetricsForRejoinedNode(NodeState.UNHEALTHY);
    return NodeState.RUNNING;
  }

  return NodeState.UNHEALTHY;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:30,代码来源:RMNodeImpl.java


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