本文整理了Java中org.apache.hadoop.yarn.api.records.Resource.getAllResourcesListCopy
方法的一些代码示例,展示了Resource.getAllResourcesListCopy
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resource.getAllResourcesListCopy
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.api.records.Resource
类名称:Resource
方法名:getAllResourcesListCopy
[英]Get list of resource information, this will be used by JAXB.
[中]获取资源信息列表,这将由JAXB使用。
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client
private Resource checkAndGetResourceProfile(String profile,
Resource overrideResource) {
Resource returnResource = overrideResource;
// if application requested a non-empty/null profile, and the
if (profile != null && !profile.isEmpty()) {
if (resourceProfilesMap == null || (!resourceProfilesMap.containsKey(
profile))) {
throw new InvalidContainerRequestException(
"Invalid profile name specified=" + profile + (
resourceProfilesMap == null ?
"" :
(", valid profile names are " + resourceProfilesMap
.keySet())));
}
returnResource = Resources.clone(resourceProfilesMap.get(profile));
for (ResourceInformation info : overrideResource
.getAllResourcesListCopy()) {
if (info.getValue() > 0) {
returnResource.setResourceInformation(info.getName(), info);
}
}
}
return returnResource;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public ResourceInfo(Resource res) {
// Make sure no NPE.
if (res != null) {
memory = res.getMemorySize();
vCores = res.getVirtualCores();
resources = Resources.clone(res);
resourceInformations.addAll(res.getAllResourcesListCopy());
}
}
内容来源于网络,如有侵权,请联系作者删除!