try { httpServer.start(); LOG.info("Web app " + webApp.name() + " started at " + httpServer.getConnectorAddress(0).getPort()); } catch (IOException e) {
try { httpServer.start(); LOG.info("Web app " + webApp.name() + " started at " + httpServer.getConnectorAddress(0).getPort()); } catch (IOException e) {
@Override public void run() { LOG.info("WebAppp /{} exiting...", webApp.name()); webApp.stop(); System.exit(0); // FINDBUG: this is intended in dev mode } }, 18); // enough time for the last local request to complete
@Override public void run() { LOG.info("WebAppp /{} exiting...", webApp.name()); webApp.stop(); System.exit(0); // FINDBUG: this is intended in dev mode } }, 18); // enough time for the last local request to complete
@Override public void run() { LOG.info("WebAppp /{} exiting...", webApp.name()); webApp.stop(); System.exit(0); // FINDBUG: this is intended in dev mode } }, 18); // enough time for the last local request to complete
@GET @Path("/containers") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) 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; }
@GET @Path("/containers") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public ContainersInfo getNodeContainers() { 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()); allContainers.add(info); } return allContainers; }
@GET @Path("/containers") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public ContainersInfo getNodeContainers() { 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()); allContainers.add(info); } return allContainers; }
@GET @Path("/containers/{containerid}") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public ContainerInfo getNodeContainer(@javax.ws.rs.core.Context HttpServletRequest hsr, @PathParam("containerid") String id) { ContainerId containerId = null; init(); try { containerId = ContainerId.fromString(id); } catch (Exception e) { throw new BadRequestException("invalid container id, " + id); } Container container = nmContext.getContainers().get(containerId); if (container == null) { throw new NotFoundException("container with id, " + id + ", not found"); } return new ContainerInfo(this.nmContext, container, uriInfo.getBaseUri() .toString(), webapp.name(), hsr.getRemoteUser()); }
@GET @Path("/containers/{containerid}") @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 }) public ContainerInfo getNodeContainer(@javax.ws.rs.core.Context HttpServletRequest hsr, @PathParam("containerid") String id) { ContainerId containerId = null; init(); try { containerId = ContainerId.fromString(id); } catch (Exception e) { throw new BadRequestException("invalid container id, " + id); } Container container = nmContext.getContainers().get(containerId); if (container == null) { throw new NotFoundException("container with id, " + id + ", not found"); } return new ContainerInfo(this.nmContext, container, uriInfo.getBaseUri() .toString(), webapp.name(), hsr.getRemoteUser()); }
@GET @Path("/containers/{containerid}") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public ContainerInfo getNodeContainer(@PathParam("containerid") String id) { ContainerId containerId = null; init(); try { containerId = ConverterUtils.toContainerId(id); } catch (Exception e) { throw new BadRequestException("invalid container id, " + id); } Container container = nmContext.getContainers().get(containerId); if (container == null) { throw new NotFoundException("container with id, " + id + ", not found"); } return new ContainerInfo(this.nmContext, container, uriInfo.getBaseUri() .toString(), webapp.name()); }
@GET @Path("/containers/{containerid}") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public ContainerInfo getNodeContainer(@PathParam("containerid") String id) { ContainerId containerId = null; init(); try { containerId = ConverterUtils.toContainerId(id); } catch (Exception e) { throw new BadRequestException("invalid container id, " + id); } Container container = nmContext.getContainers().get(containerId); if (container == null) { throw new NotFoundException("container with id, " + id + ", not found"); } return new ContainerInfo(this.nmContext, container, uriInfo.getBaseUri() .toString(), webapp.name()); }
@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()); ApplicationId appId = entry.getKey().getApplicationAttemptId() .getApplicationId(); // Allow only application-owner/admin for any type of access on the // application. if (filterAppsByUser && !hasAccess(entry.getValue().getUser(), appId, hsr)) { continue; } allContainers.add(info); } return allContainers; }
@GET @Path("/mapreduce/jobs/{jobid}/jobattempts") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public AMAttemptsInfo getJobAttempts(@PathParam("jobid") String jid) { init(); Job job = AMWebServices.getJobFromJobIdString(jid, ctx); AMAttemptsInfo amAttempts = new AMAttemptsInfo(); for (AMInfo amInfo : job.getAMInfos()) { AMAttemptInfo attempt = new AMAttemptInfo(amInfo, MRApps.toString(job .getID()), job.getUserName(), uriInfo.getBaseUri().toString(), webapp.name()); amAttempts.add(attempt); } return amAttempts; }
@GET @Path("/mapreduce/jobs/{jobid}/jobattempts") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public AMAttemptsInfo getJobAttempts(@PathParam("jobid") String jid) { init(); Job job = AMWebServices.getJobFromJobIdString(jid, ctx); AMAttemptsInfo amAttempts = new AMAttemptsInfo(); for (AMInfo amInfo : job.getAMInfos()) { AMAttemptInfo attempt = new AMAttemptInfo(amInfo, MRApps.toString(job .getID()), job.getUserName(), uriInfo.getBaseUri().toString(), webapp.name()); amAttempts.add(attempt); } return amAttempts; }
@GET @Path("/mapreduce/jobs/{jobid}/jobattempts") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public AMAttemptsInfo getJobAttempts(@PathParam("jobid") String jid) { init(); Job job = AMWebServices.getJobFromJobIdString(jid, ctx); AMAttemptsInfo amAttempts = new AMAttemptsInfo(); for (AMInfo amInfo : job.getAMInfos()) { AMAttemptInfo attempt = new AMAttemptInfo(amInfo, MRApps.toString(job .getID()), job.getUserName(), uriInfo.getBaseUri().toString(), webapp.name()); amAttempts.add(attempt); } return amAttempts; }
rc.prefix = webApp.name(); Router.Dest dest = null; try {
rc.prefix = webApp.name(); Router.Dest dest = null; try {
rc.prefix = webApp.name(); Router.Dest dest = null; try {