Esempio n. 1
0
 public TaskRunner(
     TaskTracker.TaskInProgress tip,
     TaskTracker tracker,
     JobConf conf,
     TaskTracker.RunningJob rjob)
     throws IOException {
   this.tip = tip;
   this.t = tip.getTask();
   this.tracker = tracker;
   this.conf = conf;
   this.mapOutputFile = new MapOutputFile();
   this.mapOutputFile.setConf(conf);
   this.jvmManager = tracker.getJvmManagerInstance();
   this.localdirs = conf.getLocalDirs();
   taskDistributedCacheManager = rjob.distCacheMgr;
 }
 private void startTT(JobConf conf) throws IOException, InterruptedException {
   myClock = new FakeClock(); // clock is reset.
   String localdirs = TEST_ROOT_DIR + "/userlogs/local/0," + TEST_ROOT_DIR + "/userlogs/local/1";
   conf.set(JobConf.MAPRED_LOCAL_DIR_PROPERTY, localdirs);
   tt = new TaskTracker();
   tt.setConf(new JobConf(conf));
   LocalDirAllocator localDirAllocator = new LocalDirAllocator("mapred.local.dir");
   tt.setLocalDirAllocator(localDirAllocator);
   LocalStorage localStorage = new LocalStorage(conf.getLocalDirs());
   localStorage.checkLocalDirs();
   tt.setLocalStorage(localStorage);
   localizer =
       new Localizer(FileSystem.get(conf), conf.getStrings(JobConf.MAPRED_LOCAL_DIR_PROPERTY));
   tt.setLocalizer(localizer);
   userLogManager = new UtilsForTests.InLineUserLogManager(conf);
   TaskController taskController = userLogManager.getTaskController();
   taskController.setup(localDirAllocator, localStorage);
   tt.setTaskController(taskController);
   userLogCleaner = userLogManager.getUserLogCleaner();
   userLogCleaner.setClock(myClock);
   tt.setUserLogManager(userLogManager);
   userLogManager.clearOldUserLogs(conf);
 }