Search in sources :

Example 1 with ContainersInfo

use of org.apache.hadoop.yarn.server.nodemanager.webapp.dao.ContainersInfo in project hadoop by apache.

the class NMWebServices method getNodeContainers.

@GET
@Path("/containers")
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
public ContainersInfo getNodeContainers(@javax.ws.rs.core.Context HttpServletRequest hsr) {
    init();
    ContainersInfo allContainers = new ContainersInfo();
    for (Entry<ContainerId, Container> entry : this.nmContext.getContainers().entrySet()) {
        if (entry.getValue() == null) {
            // just skip it
            continue;
        }
        ContainerInfo info = new ContainerInfo(this.nmContext, entry.getValue(), uriInfo.getBaseUri().toString(), webapp.name(), hsr.getRemoteUser());
        allContainers.add(info);
    }
    return allContainers;
}
Also used : Container(org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container) ContainerId(org.apache.hadoop.yarn.api.records.ContainerId) ContainerInfo(org.apache.hadoop.yarn.server.nodemanager.webapp.dao.ContainerInfo) ContainersInfo(org.apache.hadoop.yarn.server.nodemanager.webapp.dao.ContainersInfo) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)1 Container (org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container)1 ContainerInfo (org.apache.hadoop.yarn.server.nodemanager.webapp.dao.ContainerInfo)1 ContainersInfo (org.apache.hadoop.yarn.server.nodemanager.webapp.dao.ContainersInfo)1