Search in sources :

Example 1 with AppAttemptsInfo

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

the class RMWebServices method getAppAttempts.

@GET
@Path("/apps/{appid}/appattempts")
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
public AppAttemptsInfo getAppAttempts(@Context HttpServletRequest hsr, @PathParam("appid") String appId) {
    init();
    ApplicationId id = WebAppUtils.parseApplicationId(recordFactory, appId);
    RMApp app = rm.getRMContext().getRMApps().get(id);
    if (app == null) {
        throw new NotFoundException("app with id: " + appId + " not found");
    }
    AppAttemptsInfo appAttemptsInfo = new AppAttemptsInfo();
    for (RMAppAttempt attempt : app.getAppAttempts().values()) {
        AppAttemptInfo attemptInfo = new AppAttemptInfo(rm, attempt, app.getUser(), hsr.getScheme() + "://");
        appAttemptsInfo.add(attemptInfo);
    }
    return appAttemptsInfo;
}
Also used : RMApp(org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp) AppAttemptsInfo(org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppAttemptsInfo) AppAttemptInfo(org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppAttemptInfo) RMAppAttempt(org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt) NotFoundException(org.apache.hadoop.yarn.webapp.NotFoundException) ApplicationId(org.apache.hadoop.yarn.api.records.ApplicationId) 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 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 RMApp (org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp)1 RMAppAttempt (org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt)1 AppAttemptInfo (org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppAttemptInfo)1 AppAttemptsInfo (org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.AppAttemptsInfo)1 NotFoundException (org.apache.hadoop.yarn.webapp.NotFoundException)1