Search in sources :

Example 16 with ResourceManagerAdministrationProtocol

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;
}
Also used : ResourceManagerAdministrationProtocol(org.apache.hadoop.yarn.server.api.ResourceManagerAdministrationProtocol) ReplaceLabelsOnNodeRequest(org.apache.hadoop.yarn.server.api.protocolrecords.ReplaceLabelsOnNodeRequest)

Aggregations

ResourceManagerAdministrationProtocol (org.apache.hadoop.yarn.server.api.ResourceManagerAdministrationProtocol)16 CommandLine (org.apache.commons.cli.CommandLine)2 GnuParser (org.apache.commons.cli.GnuParser)2 MissingArgumentException (org.apache.commons.cli.MissingArgumentException)2 Options (org.apache.commons.cli.Options)2 Configuration (org.apache.hadoop.conf.Configuration)2 NodeId (org.apache.hadoop.yarn.api.records.NodeId)2 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)2 AddToClusterNodeLabelsRequest (org.apache.hadoop.yarn.server.api.protocolrecords.AddToClusterNodeLabelsRequest)2 RefreshNodesRequest (org.apache.hadoop.yarn.server.api.protocolrecords.RefreshNodesRequest)2 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 HashMap (java.util.HashMap)1 HAServiceProtocol (org.apache.hadoop.ha.HAServiceProtocol)1 HAServiceStatus (org.apache.hadoop.ha.HAServiceStatus)1 HAServiceTarget (org.apache.hadoop.ha.HAServiceTarget)1 NodeLabel (org.apache.hadoop.yarn.api.records.NodeLabel)1 Resource (org.apache.hadoop.yarn.api.records.Resource)1 ResourceOption (org.apache.hadoop.yarn.api.records.ResourceOption)1 YarnRPC (org.apache.hadoop.yarn.ipc.YarnRPC)1