Search in sources :

Example 1 with JobTaskCounterInfo

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

the class AMWebServices method getSingleTaskCounters.

@GET
@Path("/jobs/{jobid}/tasks/{taskid}/counters")
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
public JobTaskCounterInfo getSingleTaskCounters(@Context HttpServletRequest hsr, @PathParam("jobid") String jid, @PathParam("taskid") String tid) {
    init();
    Job job = getJobFromJobIdString(jid, appCtx);
    checkAccess(job, hsr);
    Task task = getTaskFromTaskIdString(tid, job);
    return new JobTaskCounterInfo(task);
}
Also used : Task(org.apache.hadoop.mapreduce.v2.app.job.Task) JobTaskCounterInfo(org.apache.hadoop.mapreduce.v2.app.webapp.dao.JobTaskCounterInfo) Job(org.apache.hadoop.mapreduce.v2.app.job.Job) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 2 with JobTaskCounterInfo

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

the class HsWebServices method getSingleTaskCounters.

@GET
@Path("/mapreduce/jobs/{jobid}/tasks/{taskid}/counters")
@Produces({ MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8, MediaType.APPLICATION_XML + "; " + JettyUtils.UTF_8 })
public JobTaskCounterInfo getSingleTaskCounters(@Context HttpServletRequest hsr, @PathParam("jobid") String jid, @PathParam("taskid") String tid) {
    init();
    Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
    checkAccess(job, hsr);
    TaskId taskID = MRApps.toTaskID(tid);
    if (taskID == null) {
        throw new NotFoundException("taskid " + tid + " not found or invalid");
    }
    Task task = job.getTask(taskID);
    if (task == null) {
        throw new NotFoundException("task not found with id " + tid);
    }
    return new JobTaskCounterInfo(task);
}
Also used : Task(org.apache.hadoop.mapreduce.v2.app.job.Task) TaskId(org.apache.hadoop.mapreduce.v2.api.records.TaskId) JobTaskCounterInfo(org.apache.hadoop.mapreduce.v2.app.webapp.dao.JobTaskCounterInfo) NotFoundException(org.apache.hadoop.yarn.webapp.NotFoundException) Job(org.apache.hadoop.mapreduce.v2.app.job.Job) 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 Job (org.apache.hadoop.mapreduce.v2.app.job.Job)2 Task (org.apache.hadoop.mapreduce.v2.app.job.Task)2 JobTaskCounterInfo (org.apache.hadoop.mapreduce.v2.app.webapp.dao.JobTaskCounterInfo)2 TaskId (org.apache.hadoop.mapreduce.v2.api.records.TaskId)1 NotFoundException (org.apache.hadoop.yarn.webapp.NotFoundException)1