本文整理了Java中org.apache.hadoop.yarn.api.records.YarnClusterMetrics.newInstance()
方法的一些代码示例,展示了YarnClusterMetrics.newInstance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClusterMetrics.newInstance()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.api.records.YarnClusterMetrics
类名称:YarnClusterMetrics
方法名:newInstance
暂无
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-common
@Override
public GetClusterMetricsResponse getClusterMetrics(
GetClusterMetricsRequest request) throws YarnException, IOException {
validateRunning();
YarnClusterMetrics clusterMetrics = YarnClusterMetrics.newInstance(1);
return GetClusterMetricsResponse.newInstance(clusterMetrics);
}
代码示例来源: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);
}
}
内容来源于网络,如有侵权,请联系作者删除!