public static TaskId NewTaskId(JobId jobId, int id, TaskType taskType)
        {
            TaskId taskId = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <TaskId>();

            taskId.SetJobId(jobId);
            taskId.SetId(id);
            taskId.SetTaskType(taskType);
            return(taskId);
        }
Exemple #2
0
        public static TaskId ToYarn(TaskID id)
        {
            TaskId taskId = recordFactory.NewRecordInstance <TaskId>();

            taskId.SetId(id.GetId());
            taskId.SetTaskType(ToYarn(id.GetTaskType()));
            taskId.SetJobId(ToYarn(id.GetJobID()));
            return(taskId);
        }
Exemple #3
0
        private TaskId GetNewTaskID()
        {
            TaskId taskId = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <TaskId>();

            taskId.SetId(++taskCounter);
            taskId.SetJobId(jobId);
            taskId.SetTaskType(mockTask.GetType());
            return(taskId);
        }
Exemple #4
0
        //TODO_get.set
        public virtual void TestTaskIDtoString()
        {
            TaskId tid = RecordFactoryProvider.GetRecordFactory(null).NewRecordInstance <TaskId
                                                                                         >();

            tid.SetJobId(RecordFactoryProvider.GetRecordFactory(null).NewRecordInstance <JobId
                                                                                         >());
            tid.GetJobId().SetAppId(ApplicationId.NewInstance(0, 0));
            tid.SetTaskType(TaskType.Map);
            TaskType type = tid.GetTaskType();

            System.Console.Error.WriteLine(type);
            type = TaskType.Reduce;
            System.Console.Error.WriteLine(type);
            System.Console.Error.WriteLine(tid.GetTaskType());
            NUnit.Framework.Assert.AreEqual("task_0_0000_m_000000", MRApps.ToString(tid));
            tid.SetTaskType(TaskType.Reduce);
            NUnit.Framework.Assert.AreEqual("task_0_0000_r_000000", MRApps.ToString(tid));
        }
Exemple #5
0
        public static Task NewTask(JobId jid, int i, int m, bool hasFailedTasks)
        {
            TaskId tid = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <TaskId>();

            tid.SetJobId(jid);
            tid.SetId(i);
            tid.SetTaskType(TaskTypes.Next());
            TaskReport report = NewTaskReport(tid);
            IDictionary <TaskAttemptId, TaskAttempt> attempts = NewTaskAttempts(tid, m);

            return(new _Task_370(tid, report, hasFailedTasks, attempts));
        }