Search in sources :

Example 1 with AMAttemptsInfo

use of org.apache.hadoop.mapreduce.v2.app.webapp.dao.AMAttemptsInfo in project hadoop by apache.

the class HsWebServices method getJobAttempts.

@GET
@Path("/mapreduce/jobs/{jobid}/jobattempts")
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
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;
}
Also used : AMInfo(org.apache.hadoop.mapreduce.v2.api.records.AMInfo) Job(org.apache.hadoop.mapreduce.v2.app.job.Job) AMAttemptsInfo(org.apache.hadoop.mapreduce.v2.hs.webapp.dao.AMAttemptsInfo) AMAttemptInfo(org.apache.hadoop.mapreduce.v2.hs.webapp.dao.AMAttemptInfo) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 2 with AMAttemptsInfo

use of org.apache.hadoop.mapreduce.v2.app.webapp.dao.AMAttemptsInfo in project hadoop by apache.

the class AMWebServices method getJobAttempts.

@GET
@Path("/jobs/{jobid}/jobattempts")
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
public AMAttemptsInfo getJobAttempts(@PathParam("jobid") String jid) {
    init();
    Job job = getJobFromJobIdString(jid, appCtx);
    AMAttemptsInfo amAttempts = new AMAttemptsInfo();
    for (AMInfo amInfo : job.getAMInfos()) {
        AMAttemptInfo attempt = new AMAttemptInfo(amInfo, MRApps.toString(job.getID()), job.getUserName());
        amAttempts.add(attempt);
    }
    return amAttempts;
}
Also used : AMInfo(org.apache.hadoop.mapreduce.v2.api.records.AMInfo) Job(org.apache.hadoop.mapreduce.v2.app.job.Job) AMAttemptsInfo(org.apache.hadoop.mapreduce.v2.app.webapp.dao.AMAttemptsInfo) AMAttemptInfo(org.apache.hadoop.mapreduce.v2.app.webapp.dao.AMAttemptInfo) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 AMInfo (org.apache.hadoop.mapreduce.v2.api.records.AMInfo)2 Job (org.apache.hadoop.mapreduce.v2.app.job.Job)2 AMAttemptInfo (org.apache.hadoop.mapreduce.v2.app.webapp.dao.AMAttemptInfo)1 AMAttemptsInfo (org.apache.hadoop.mapreduce.v2.app.webapp.dao.AMAttemptsInfo)1 AMAttemptInfo (org.apache.hadoop.mapreduce.v2.hs.webapp.dao.AMAttemptInfo)1 AMAttemptsInfo (org.apache.hadoop.mapreduce.v2.hs.webapp.dao.AMAttemptsInfo)1