@GET @Path(RMWSConsts.APPS_APPID_QUEUE) @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 }) @Override public AppQueue getAppQueue(@Context HttpServletRequest hsr, @PathParam(RMWSConsts.APPID) String appId) throws AuthorizationException { initForReadableEndpoints(); UserGroupInformation callerUGI = getCallerUserGroupInformation(hsr, true); String userName = "UNKNOWN-USER"; if (callerUGI != null) { userName = callerUGI.getUserName(); } RMApp app = null; try { app = getRMAppForAppId(appId); } catch (NotFoundException e) { RMAuditLogger.logFailure(userName, AuditConstants.GET_APP_QUEUE, "UNKNOWN", "RMWebService", "Trying to get queue of an absent application " + appId); throw e; } AppQueue ret = new AppQueue(); ret.setQueue(app.getQueue()); return ret; }
@GET @Path("/apps/{appid}/queue") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public AppQueue getAppQueue(@Context HttpServletRequest hsr, @PathParam("appid") String appId) throws AuthorizationException { init(); UserGroupInformation callerUGI = getCallerUserGroupInformation(hsr, true); String userName = "UNKNOWN-USER"; if (callerUGI != null) { userName = callerUGI.getUserName(); } RMApp app = null; try { app = getRMAppForAppId(appId); } catch (NotFoundException e) { RMAuditLogger.logFailure(userName, AuditConstants.KILL_APP_REQUEST, "UNKNOWN", "RMWebService", "Trying to get state of an absent application " + appId); throw e; } AppQueue ret = new AppQueue(); ret.setQueue(app.getQueue()); return ret; }
@GET @Path("/apps/{appid}/queue") @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public AppQueue getAppQueue(@Context HttpServletRequest hsr, @PathParam("appid") String appId) throws AuthorizationException { init(); UserGroupInformation callerUGI = getCallerUserGroupInformation(hsr, true); String userName = "UNKNOWN-USER"; if (callerUGI != null) { userName = callerUGI.getUserName(); } RMApp app = null; try { app = getRMAppForAppId(appId); } catch (NotFoundException e) { RMAuditLogger.logFailure(userName, AuditConstants.KILL_APP_REQUEST, "UNKNOWN", "RMWebService", "Trying to get state of an absent application " + appId); throw e; } AppQueue ret = new AppQueue(); ret.setQueue(app.getQueue()); return ret; }
@PUT @Path(RMWSConsts.APPS_APPID_QUEUE) @Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 }) @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Override public Response updateAppQueue(AppQueue targetQueue, @Context HttpServletRequest hsr, @PathParam(RMWSConsts.APPID) String appId) throws AuthorizationException, YarnException, InterruptedException, IOException { UserGroupInformation callerUGI = getCallerUserGroupInformation(hsr, true); initForWritableEndpoints(callerUGI, false); String userName = callerUGI.getUserName(); RMApp app = null; try { app = getRMAppForAppId(appId); } catch (NotFoundException e) { RMAuditLogger.logFailure(userName, AuditConstants.MOVE_APP_REQUEST, "UNKNOWN", "RMWebService", "Trying to move an absent application " + appId); throw e; } if (!app.getQueue().equals(targetQueue.getQueue())) { // user is attempting to change queue. return moveApp(app, callerUGI, targetQueue.getQueue()); } AppQueue ret = new AppQueue(); ret.setQueue(app.getQueue()); return Response.status(Status.OK).entity(ret).build(); }
ret.setQueue(app.getQueue()); return Response.status(Status.OK).entity(ret).build();
ret.setQueue(app.getQueue());
ret.setQueue(app.getQueue()); return Response.status(Status.OK).entity(ret).build();
ret.setQueue(app.getQueue());
ret.setQueue(app.getQueue()); return Response.status(Status.OK).entity(ret).build();