org.apache.hadoop.yarn.api.ApplicationClientProtocol.getClusterMetrics()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中org.apache.hadoop.yarn.api.ApplicationClientProtocol.getClusterMetrics()方法的一些代码示例,展示了ApplicationClientProtocol.getClusterMetrics()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationClientProtocol.getClusterMetrics()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.api.ApplicationClientProtocol
类名称:ApplicationClientProtocol
方法名:getClusterMetrics

ApplicationClientProtocol.getClusterMetrics介绍

[英]The interface used by clients to get metrics about the cluster from the ResourceManager.

The ResourceManager responds with a GetClusterMetricsResponse which includes the YarnClusterMetrics with details such as number of current nodes in the cluster.
[中]客户端用于从ResourceManager获取有关群集的度量的接口。
ResourceManager响应一个GetClusterMetricsResponse,其中包括yanclusterMetrics以及集群中当前节点数等详细信息。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-router

@Override
public GetClusterMetricsResponse getClusterMetrics(
  GetClusterMetricsRequest request) throws YarnException, IOException {
 return clientRMProxy.getClusterMetrics(request);
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client

@Override
public YarnClusterMetrics getYarnClusterMetrics() throws YarnException,
  IOException {
 GetClusterMetricsRequest request =
   Records.newRecord(GetClusterMetricsRequest.class);
 GetClusterMetricsResponse response = rmClient.getClusterMetrics(request);
 return response.getClusterMetrics();
}

代码示例来源:origin: io.hops/hadoop-yarn-client

@Override
public YarnClusterMetrics getYarnClusterMetrics() throws YarnException,
  IOException {
 GetClusterMetricsRequest request =
   Records.newRecord(GetClusterMetricsRequest.class);
 GetClusterMetricsResponse response = rmClient.getClusterMetrics(request);
 return response.getClusterMetrics();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-client

@Override
public YarnClusterMetrics getYarnClusterMetrics() throws YarnException,
  IOException {
 GetClusterMetricsRequest request =
   Records.newRecord(GetClusterMetricsRequest.class);
 GetClusterMetricsResponse response = rmClient.getClusterMetrics(request);
 return response.getClusterMetrics();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-client

@Override
public YarnClusterMetrics getYarnClusterMetrics() throws YarnException,
  IOException {
 GetClusterMetricsRequest request =
   Records.newRecord(GetClusterMetricsRequest.class);
 GetClusterMetricsResponse response = rmClient.getClusterMetrics(request);
 return response.getClusterMetrics();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

@Override
public GetClusterMetricsResponseProto getClusterMetrics(RpcController arg0,
  GetClusterMetricsRequestProto proto) throws ServiceException {
 GetClusterMetricsRequestPBImpl request = new GetClusterMetricsRequestPBImpl(proto);
 try {
  GetClusterMetricsResponse response = real.getClusterMetrics(request);
  return ((GetClusterMetricsResponsePBImpl)response).getProto();
 } catch (YarnException e) {
  throw new ServiceException(e);
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@Override
public GetClusterMetricsResponseProto getClusterMetrics(RpcController arg0,
  GetClusterMetricsRequestProto proto) throws ServiceException {
 GetClusterMetricsRequestPBImpl request = new GetClusterMetricsRequestPBImpl(proto);
 try {
  GetClusterMetricsResponse response = real.getClusterMetrics(request);
  return ((GetClusterMetricsResponsePBImpl)response).getProto();
 } catch (YarnException e) {
  throw new ServiceException(e);
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common

@Override
public GetClusterMetricsResponseProto getClusterMetrics(RpcController arg0,
  GetClusterMetricsRequestProto proto) throws ServiceException {
 GetClusterMetricsRequestPBImpl request = new GetClusterMetricsRequestPBImpl(proto);
 try {
  GetClusterMetricsResponse response = real.getClusterMetrics(request);
  return ((GetClusterMetricsResponsePBImpl)response).getProto();
 } catch (YarnException e) {
  throw new ServiceException(e);
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-mapreduce-client-jobclient

clusterMetricsResponse.setClusterMetrics(recordFactory.newRecordInstance(
  YarnClusterMetrics.class));
when(clientRMProtocol.getClusterMetrics(any(GetClusterMetricsRequest.class)))
.thenReturn(clusterMetricsResponse);
delegate.getClusterMetrics();
verify(clientRMProtocol).getClusterMetrics(any(GetClusterMetricsRequest.class));

相关文章

微信公众号

最新文章

更多

ApplicationClientProtocol类方法