Exemple #1
0
        public static Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job NewJob(ApplicationId appID
                                                                        , int i, int n, int m, Path confFile, bool hasFailedTasks)
        {
            JobId     id     = NewJobID(appID, i);
            string    name   = NewJobName();
            JobReport report = NewJobReport(id);
            IDictionary <TaskId, Task> tasks = NewTasks(id, n, m, hasFailedTasks);

            MockJobs.TaskCount taskCount = GetTaskCount(tasks.Values);
            Counters           counters  = GetCounters(tasks.Values);
            Path configFile = confFile;
            IDictionary <JobACL, AccessControlList> tmpJobACLs = new Dictionary <JobACL, AccessControlList
                                                                                 >();
            Configuration conf = new Configuration();

            conf.Set(JobACL.ViewJob.GetAclName(), "testuser");
            conf.SetBoolean(MRConfig.MrAclsEnabled, true);
            JobACLsManager aclsManager = new JobACLsManager(conf);

            tmpJobACLs = aclsManager.ConstructJobACLs(conf);
            IDictionary <JobACL, AccessControlList> jobACLs = tmpJobACLs;

            return(new _Job_503(id, name, report, counters, tasks, taskCount, configFile, jobACLs
                                , conf));
        }
Exemple #2
0
 internal static MockJobs.TaskCount GetTaskCount(ICollection <Task> tasks)
 {
     MockJobs.TaskCount tc = new MockJobs.TaskCount();
     foreach (Task task in tasks)
     {
         tc.Incr(task);
     }
     return(tc);
 }
Exemple #3
0
 public _Job_503(JobId id, string name, JobReport report, Counters counters, IDictionary
                 <TaskId, Task> tasks, MockJobs.TaskCount taskCount, Path configFile, IDictionary
                 <JobACL, AccessControlList> jobACLs, Configuration conf)
 {
     this.id         = id;
     this.name       = name;
     this.report     = report;
     this.counters   = counters;
     this.tasks      = tasks;
     this.taskCount  = taskCount;
     this.configFile = configFile;
     this.jobACLs    = jobACLs;
     this.conf       = conf;
 }