本文整理了Java中org.apache.hadoop.yarn.api.records.YarnClusterMetrics.getNumLostNodeManagers()
方法的一些代码示例,展示了YarnClusterMetrics.getNumLostNodeManagers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClusterMetrics.getNumLostNodeManagers()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.api.records.YarnClusterMetrics
类名称:YarnClusterMetrics
方法名:getNumLostNodeManagers
[英]Get the number of LostNodeManager
s in the cluster.
[中]获取群集中的LostNodeManager
个数。
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client
protected NodesInformation getNodesInfo() {
NodesInformation nodeInfo = new NodesInformation();
YarnClusterMetrics yarnClusterMetrics;
try {
yarnClusterMetrics = client.getYarnClusterMetrics();
} catch (IOException ie) {
LOG.error("Unable to fetch cluster metrics", ie);
return nodeInfo;
} catch (YarnException ye) {
LOG.error("Unable to fetch cluster metrics", ye);
return nodeInfo;
}
nodeInfo.decommissionedNodes =
yarnClusterMetrics.getNumDecommissionedNodeManagers();
nodeInfo.totalNodes = yarnClusterMetrics.getNumNodeManagers();
nodeInfo.runningNodes = yarnClusterMetrics.getNumActiveNodeManagers();
nodeInfo.lostNodes = yarnClusterMetrics.getNumLostNodeManagers();
nodeInfo.unhealthyNodes = yarnClusterMetrics.getNumUnhealthyNodeManagers();
nodeInfo.rebootedNodes = yarnClusterMetrics.getNumRebootedNodeManagers();
return nodeInfo;
}
代码示例来源:origin: io.hops/hadoop-yarn-client
protected NodesInformation getNodesInfo() {
NodesInformation nodeInfo = new NodesInformation();
YarnClusterMetrics yarnClusterMetrics;
try {
yarnClusterMetrics = client.getYarnClusterMetrics();
} catch (IOException ie) {
LOG.error("Unable to fetch cluster metrics", ie);
return nodeInfo;
} catch (YarnException ye) {
LOG.error("Unable to fetch cluster metrics", ye);
return nodeInfo;
}
nodeInfo.decommissionedNodes =
yarnClusterMetrics.getNumDecommissionedNodeManagers();
nodeInfo.totalNodes = yarnClusterMetrics.getNumNodeManagers();
nodeInfo.runningNodes = yarnClusterMetrics.getNumActiveNodeManagers();
nodeInfo.lostNodes = yarnClusterMetrics.getNumLostNodeManagers();
nodeInfo.unhealthyNodes = yarnClusterMetrics.getNumUnhealthyNodeManagers();
nodeInfo.rebootedNodes = yarnClusterMetrics.getNumRebootedNodeManagers();
return nodeInfo;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-router
public static GetClusterMetricsResponse merge(
Collection<GetClusterMetricsResponse> responses) {
YarnClusterMetrics tmp = YarnClusterMetrics.newInstance(0);
for (GetClusterMetricsResponse response : responses) {
YarnClusterMetrics metrics = response.getClusterMetrics();
tmp.setNumNodeManagers(
tmp.getNumNodeManagers() + metrics.getNumNodeManagers());
tmp.setNumActiveNodeManagers(
tmp.getNumActiveNodeManagers() + metrics.getNumActiveNodeManagers());
tmp.setNumDecommissionedNodeManagers(
tmp.getNumDecommissionedNodeManagers() + metrics
.getNumDecommissionedNodeManagers());
tmp.setNumLostNodeManagers(
tmp.getNumLostNodeManagers() + metrics.getNumLostNodeManagers());
tmp.setNumRebootedNodeManagers(tmp.getNumRebootedNodeManagers() + metrics
.getNumRebootedNodeManagers());
tmp.setNumUnhealthyNodeManagers(
tmp.getNumUnhealthyNodeManagers() + metrics
.getNumUnhealthyNodeManagers());
}
return GetClusterMetricsResponse.newInstance(tmp);
}
}
内容来源于网络,如有侵权,请联系作者删除!