示例#1
0
 public virtual Task GetTask(TaskId taskId)
 {
     if (tasksLoaded.Get())
     {
         return(tasks[taskId]);
     }
     else
     {
         TaskID        oldTaskId     = TypeConverter.FromYarn(taskId);
         CompletedTask completedTask = new CompletedTask(taskId, jobInfo.GetAllTasks()[oldTaskId
                                                         ]);
         return(completedTask);
     }
 }
示例#2
0
        // Computes finished maps similar to RecoveryService...
        private long ComputeFinishedMaps(JobHistoryParser.JobInfo jobInfo, int numMaps, int
                                         numSuccessfulMaps)
        {
            if (numMaps == numSuccessfulMaps)
            {
                return(jobInfo.GetFinishedMaps());
            }
            long numFinishedMaps = 0;
            IDictionary <TaskID, JobHistoryParser.TaskInfo> taskInfos = jobInfo.GetAllTasks();

            foreach (JobHistoryParser.TaskInfo taskInfo in taskInfos.Values)
            {
                if (TaskState.Succeeded.ToString().Equals(taskInfo.GetTaskStatus()))
                {
                    ++numFinishedMaps;
                }
            }
            return(numFinishedMaps);
        }