public virtual TasksInfo GetJobTasks(HttpServletRequest hsr, string jid, string type ) { Init(); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = AMWebServices.GetJobFromJobIdString (jid, ctx); CheckAccess(job, hsr); TasksInfo allTasks = new TasksInfo(); foreach (Task task in job.GetTasks().Values) { TaskType ttype = null; if (type != null && !type.IsEmpty()) { try { ttype = MRApps.TaskType(type); } catch (YarnRuntimeException) { throw new BadRequestException("tasktype must be either m or r"); } } if (ttype != null && task.GetType() != ttype) { continue; } allTasks.Add(new TaskInfo(task)); } return(allTasks); }
public virtual TaskAttemptsInfo GetJobTaskAttempts(HttpServletRequest hsr, string jid, string tid) { Init(); TaskAttemptsInfo attempts = new TaskAttemptsInfo(); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = AMWebServices.GetJobFromJobIdString (jid, ctx); CheckAccess(job, hsr); Task task = AMWebServices.GetTaskFromTaskIdString(tid, job); foreach (TaskAttempt ta in task.GetAttempts().Values) { if (ta != null) { if (task.GetType() == TaskType.Reduce) { attempts.Add(new ReduceTaskAttemptInfo(ta, task.GetType())); } else { attempts.Add(new TaskAttemptInfo(ta, task.GetType(), false)); } } } return(attempts); }
public virtual JobCounterInfo GetJobCounters(HttpServletRequest hsr, string jid) { Init(); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = AMWebServices.GetJobFromJobIdString (jid, ctx); CheckAccess(job, hsr); return(new JobCounterInfo(this.ctx, job)); }
public virtual TaskInfo GetJobTask(HttpServletRequest hsr, string jid, string tid ) { Init(); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = AMWebServices.GetJobFromJobIdString (jid, ctx); CheckAccess(job, hsr); Task task = AMWebServices.GetTaskFromTaskIdString(tid, job); return(new TaskInfo(task)); }
public virtual JobTaskAttemptCounterInfo GetJobTaskAttemptIdCounters(HttpServletRequest hsr, string jid, string tid, string attId) { Init(); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = AMWebServices.GetJobFromJobIdString (jid, ctx); CheckAccess(job, hsr); Task task = AMWebServices.GetTaskFromTaskIdString(tid, job); TaskAttempt ta = AMWebServices.GetTaskAttemptFromTaskAttemptString(attId, task); return(new JobTaskAttemptCounterInfo(ta)); }
public virtual AMAttemptsInfo GetJobAttempts(string jid) { Init(); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = AMWebServices.GetJobFromJobIdString (jid, ctx); AMAttemptsInfo amAttempts = new AMAttemptsInfo(); foreach (AMInfo amInfo in job.GetAMInfos()) { AMAttemptInfo attempt = new AMAttemptInfo(amInfo, MRApps.ToString(job.GetID()), job .GetUserName(), uriInfo.GetBaseUri().ToString(), webapp.Name()); amAttempts.Add(attempt); } return(amAttempts); }
public virtual ConfInfo GetJobConf(HttpServletRequest hsr, string jid) { Init(); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = AMWebServices.GetJobFromJobIdString (jid, ctx); CheckAccess(job, hsr); ConfInfo info; try { info = new ConfInfo(job); } catch (IOException) { throw new NotFoundException("unable to load configuration for job: " + jid); } return(info); }
public virtual TaskAttemptInfo GetJobTaskAttemptId(HttpServletRequest hsr, string jid, string tid, string attId) { Init(); Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job job = AMWebServices.GetJobFromJobIdString (jid, ctx); CheckAccess(job, hsr); Task task = AMWebServices.GetTaskFromTaskIdString(tid, job); TaskAttempt ta = AMWebServices.GetTaskAttemptFromTaskAttemptString(attId, task); if (task.GetType() == TaskType.Reduce) { return(new ReduceTaskAttemptInfo(ta, task.GetType())); } else { return(new TaskAttemptInfo(ta, task.GetType(), false)); } }
public virtual JobTaskCounterInfo GetSingleTaskCounters(HttpServletRequest hsr, string jid, string tid) { Init(); Org.Apache.Hadoop.Mapreduce.V2.App.Job.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)); }