use of org.apache.hadoop.yarn.server.api.ResourceManagerAdministrationProtocol in project hadoop by apache.
the class RMAdminCLI method replaceLabelsOnNodes.
private int replaceLabelsOnNodes(Map<NodeId, Set<String>> map, boolean failOnUnknownNodes, boolean directlyAccessNodeLabelStore) throws IOException, YarnException {
if (directlyAccessNodeLabelStore) {
getNodeLabelManagerInstance(getConf()).replaceLabelsOnNode(map);
} else {
ResourceManagerAdministrationProtocol adminProtocol = createAdminProtocol();
ReplaceLabelsOnNodeRequest request = ReplaceLabelsOnNodeRequest.newInstance(map);
request.setFailOnUnknownNodes(failOnUnknownNodes);
adminProtocol.replaceLabelsOnNode(request);
}
return 0;
}
Aggregations