本文整理了Java中org.apache.hadoop.yarn.api.ApplicationClientProtocol.getClusterNodeAttributes()
方法的一些代码示例,展示了ApplicationClientProtocol.getClusterNodeAttributes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationClientProtocol.getClusterNodeAttributes()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.api.ApplicationClientProtocol
类名称:ApplicationClientProtocol
方法名:getClusterNodeAttributes
[英]The interface used by client to get node attributes available in ResourceManager.
[中]客户端用于获取ResourceManager中可用的节点属性的接口。
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-router
@Override
public GetClusterNodeAttributesResponse getClusterNodeAttributes(
GetClusterNodeAttributesRequest request)
throws YarnException, IOException {
return clientRMProxy.getClusterNodeAttributes(request);
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client
@Override
public Set<NodeAttributeInfo> getClusterAttributes()
throws YarnException, IOException {
GetClusterNodeAttributesRequest request =
GetClusterNodeAttributesRequest.newInstance();
return rmClient.getClusterNodeAttributes(request).getNodeAttributes();
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client
private int printClusterAttributes() throws IOException, YarnException {
ApplicationClientProtocol protocol = createApplicationProtocol();
GetClusterNodeAttributesRequest request =
GetClusterNodeAttributesRequest.newInstance();
GetClusterNodeAttributesResponse response =
protocol.getClusterNodeAttributes(request);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter(
new OutputStreamWriter(baos, Charset.forName("UTF-8")));
writer.format(NODEATTRIBUTEINFO, "Attribute", "Type");
for (NodeAttributeInfo attr : response.getNodeAttributes()) {
writer.format(NODEATTRIBUTEINFO, getKeyString(attr.getAttributeKey()),
attr.getAttributeType().name());
}
writer.close();
sysOut.println(baos.toString("UTF-8"));
return 0;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common
@Override
public GetClusterNodeAttributesResponseProto getClusterNodeAttributes(
RpcController controller,
YarnServiceProtos.GetClusterNodeAttributesRequestProto proto)
throws ServiceException {
GetClusterNodeAttributesRequest req =
new GetClusterNodeAttributesRequestPBImpl(proto);
try {
GetClusterNodeAttributesResponse resp =
real.getClusterNodeAttributes(req);
return ((GetClusterNodeAttributesResponsePBImpl) resp).getProto();
} catch (YarnException ye) {
throw new ServiceException(ye);
} catch (IOException ie) {
throw new ServiceException(ie);
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
GetClusterNodeAttributesRequest.newInstance();
GetClusterNodeAttributesResponse response =
client.getClusterNodeAttributes(request);
Set<NodeAttributeInfo> attributes = response.getNodeAttributes();
Assert.assertEquals("Size not correct", 3, attributes.size());
内容来源于网络,如有侵权,请联系作者删除!