Search in sources :

Example 6 with NodeLabelsInfo

use of org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeLabelsInfo in project hadoop by apache.

the class RMWebServices method getLabelsOnNode.

@GET
@Path("/nodes/{nodeId}/get-labels")
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
public NodeLabelsInfo getLabelsOnNode(@Context HttpServletRequest hsr, @PathParam("nodeId") String nodeId) throws IOException {
    init();
    NodeId nid = ConverterUtils.toNodeIdWithDefaultPort(nodeId);
    List<NodeLabel> labels = new ArrayList<NodeLabel>(rm.getRMContext().getNodeLabelManager().getLabelsInfoByNode(nid));
    return new NodeLabelsInfo(labels);
}
Also used : NodeLabel(org.apache.hadoop.yarn.api.records.NodeLabel) NodeLabelsInfo(org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeLabelsInfo) NodeId(org.apache.hadoop.yarn.api.records.NodeId) ArrayList(java.util.ArrayList) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

NodeLabelsInfo (org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeLabelsInfo)6 ClientResponse (com.sun.jersey.api.client.ClientResponse)3 WebResource (com.sun.jersey.api.client.WebResource)3 ArrayList (java.util.ArrayList)3 GET (javax.ws.rs.GET)3 Path (javax.ws.rs.Path)3 Produces (javax.ws.rs.Produces)3 NodeLabel (org.apache.hadoop.yarn.api.records.NodeLabel)3 NodeLabelInfo (org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeLabelInfo)3 Test (org.junit.Test)3 NodeId (org.apache.hadoop.yarn.api.records.NodeId)2 NodeToLabelsInfo (org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeToLabelsInfo)2 MultivaluedMapImpl (com.sun.jersey.core.util.MultivaluedMapImpl)1 EnumSet (java.util.EnumSet)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 LabelsToNodesInfo (org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.LabelsToNodesInfo)1