Ejemplo n.º 1
0
 internal MyJobImpl(TestRuntimeEstimators _enclosing, JobId jobID, int numMaps, int
                    numReduces)
 {
     this._enclosing = _enclosing;
     this.jobID      = jobID;
     for (int i = 0; i < numMaps; ++i)
     {
         Task newTask = new TestRuntimeEstimators.MyTaskImpl(this, jobID, i, TaskType.Map);
         this.mapTasks[newTask.GetID()] = newTask;
         this.allTasks[newTask.GetID()] = newTask;
     }
     for (int i_1 = 0; i_1 < numReduces; ++i_1)
     {
         Task newTask = new TestRuntimeEstimators.MyTaskImpl(this, jobID, i_1, TaskType.Reduce
                                                             );
         this.reduceTasks[newTask.GetID()] = newTask;
         this.allTasks[newTask.GetID()]    = newTask;
     }
     // give every task an attempt
     foreach (Task task in this.allTasks.Values)
     {
         TestRuntimeEstimators.MyTaskImpl myTaskImpl = (TestRuntimeEstimators.MyTaskImpl)task;
         myTaskImpl.AddAttempt();
     }
 }
Ejemplo n.º 2
0
 internal MyTaskImpl(TestRuntimeEstimators _enclosing, JobId jobID, int index, TaskType
                     type)
 {
     this._enclosing = _enclosing;
     this.taskID     = this._enclosing.recordFactory.NewRecordInstance <TaskId>();
     this.taskID.SetId(index);
     this.taskID.SetTaskType(type);
     this.taskID.SetJobId(jobID);
 }
Ejemplo n.º 3
0
 public MyAppMaster(TestRuntimeEstimators _enclosing, Clock clock)
     : base(typeof(TestRuntimeEstimators.MyAppMaster).FullName)
 {
     this._enclosing = _enclosing;
     if (clock == null)
     {
         clock = new SystemClock();
     }
     this.clock = clock;
     TestRuntimeEstimators.Log.Info("Created MyAppMaster");
 }
Ejemplo n.º 4
0
 internal MyAppContext(TestRuntimeEstimators _enclosing, int numberMaps, int numberReduces
                       )
 {
     this._enclosing      = _enclosing;
     this.myApplicationID = ApplicationId.NewInstance(this._enclosing.clock.GetTime(),
                                                      1);
     this.myAppAttemptID = ApplicationAttemptId.NewInstance(this.myApplicationID, 0);
     this.myJobID        = this._enclosing.recordFactory.NewRecordInstance <JobId>();
     this.myJobID.SetAppId(this.myApplicationID);
     Org.Apache.Hadoop.Mapreduce.V2.App.Job.Job myJob = new TestRuntimeEstimators.MyJobImpl
                                                            (this, this.myJobID, numberMaps, numberReduces);
     this.allJobs = Sharpen.Collections.SingletonMap(this.myJobID, myJob);
 }
Ejemplo n.º 5
0
            internal MyTaskAttemptImpl(TestRuntimeEstimators _enclosing, TaskId taskID, int index
                                       , Clock clock)
            {
                this._enclosing = _enclosing;

                /*
                 * We follow the pattern of the real XxxImpl .  We create a job and initialize
                 * it with a full suite of tasks which in turn have one attempt each in the
                 * NEW state.  Attempts transition only from NEW to RUNNING to SUCCEEDED .
                 */
                this.myAttemptID = this._enclosing.recordFactory.NewRecordInstance <TaskAttemptId>
                                       ();
                this.myAttemptID.SetId(index);
                this.myAttemptID.SetTaskId(taskID);
            }
Ejemplo n.º 6
0
 internal SpeculationRequestEventHandler(TestRuntimeEstimators _enclosing)
 {
     this._enclosing = _enclosing;
 }