Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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));
 }
Beispiel #4
0
        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));
        }
Beispiel #5
0
        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));
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
        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));
            }
        }
Beispiel #9
0
        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));
        }