Package org.apache.hadoop.mapred.UtilsForTests

Examples of org.apache.hadoop.mapred.UtilsForTests.FakeClock


        logRetainHours);
    userLogManager.addLogEvent(jce);
  }

  private void startTT(Configuration conf) throws IOException {
    myClock = new FakeClock(); // clock is reset.
    tt = new TaskTracker();
    tt.setConf(new JobConf(conf));
    localizer = new Localizer(FileSystem.get(conf), conf
        .getStrings(JobConf.MAPRED_LOCAL_DIR_PROPERTY));
    tt.setLocalizer(localizer);
View Full Code Here


    conf.setLong("mapred.fairscheduler.locality.delay.node", 5000);
    conf.setLong("mapred.fairscheduler.locality.delay.rack", 10000);
    conf.set("mapred.job.tracker", "localhost:0");
    conf.set("mapred.job.tracker.http.address", "0.0.0.0:0");
    taskTrackerManager = new FakeTaskTrackerManager(numRacks, numNodesPerRack);
    clock = new FakeClock();
    try {
      jobTracker = new JobTracker(conf, clock);
    } catch (Exception e) {
      throw new RuntimeException("Could not start JT", e);
    }
View Full Code Here

        logRetainHours);
    userLogManager.addLogEvent(jce);
  }

  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));
View Full Code Here

    // clear userlog directory
    // job directories will be added with 3 hours as retain hours.
    Configuration conf = new Configuration();
    conf.setInt(MRJobConfig.USER_LOG_RETAIN_HOURS, 3);
    taskLogCleanupThread = new UserLogCleaner(conf);
    myClock = new FakeClock(); // clock is reset.
    taskLogCleanupThread.setClock(myClock);
    taskLogCleanupThread.clearOldUserLogs(conf);
    tt.setTaskLogCleanupThread(taskLogCleanupThread);
    assertFalse(foo.exists());
    assertFalse(bar.exists());
View Full Code Here

        JobConf conf = new JobConf();
        conf.set(JTConfig.JT_IPC_ADDRESS, "localhost:0");
        conf.set(JTConfig.JT_HTTP_ADDRESS, "0.0.0.0:0");
        conf.setClass("topology.node.switch.mapping.impl",
            StaticMapping.class, DNSToSwitchMapping.class);
        jobTracker = new FakeJobTracker(conf, new FakeClock(), trackers);
        // Set up the Topology Information
        for (int i = 0; i < hosts.length; i++) {
          StaticMapping.addNodeToRack(hosts[i], racks[i]);
        }
        for (String s: trackers) {
View Full Code Here

    conf.setLong("mapred.fairscheduler.locality.delay.node", 5000);
    conf.setLong("mapred.fairscheduler.locality.delay.rack", 10000);
    conf.set("mapred.job.tracker", "localhost:0");
    conf.set("mapred.job.tracker.http.address", "0.0.0.0:0");
    taskTrackerManager = new FakeTaskTrackerManager(numRacks, numNodesPerRack);
    clock = new FakeClock();
    try {
      jobTracker = new JobTracker(conf, clock);
    } catch (Exception e) {
      throw new RuntimeException("Could not start JT", e);
    }
View Full Code Here

    conf.setLong("mapred.fairscheduler.locality.delay.node", 5000);
    conf.setLong("mapred.fairscheduler.locality.delay.rack", 10000);
    conf.set("mapred.job.tracker", "localhost:0");
    conf.set("mapred.job.tracker.http.address", "0.0.0.0:0");
    taskTrackerManager = new FakeTaskTrackerManager(numRacks, numNodesPerRack);
    clock = new FakeClock();
    try {
      jobTracker = new JobTracker(conf, clock);
      jobTracker.setSafeModeInternal(JobTracker.SafeModeAction.SAFEMODE_ENTER);
      jobTracker.initializeFilesystem();
      jobTracker.setSafeModeInternal(JobTracker.SafeModeAction.SAFEMODE_LEAVE);
View Full Code Here

        conf.setClass(JTConfig.JT_TASK_SCHEDULER,
            FakeTaskScheduler.class, TaskScheduler.class);

        conf.set(JTConfig.JT_INSTRUMENTATION,
            FakeJobTrackerMetricsInst.class.getName());
        jobTracker = new FakeJobTracker(conf, new FakeClock(), trackers);
        mi = (FakeJobTrackerMetricsInst) jobTracker.getInstrumentation();
        for (String tracker : trackers) {
          FakeObjectUtilities.establishFirstContact(jobTracker, tracker);
        }
       
View Full Code Here

  protected void setUp() throws Exception {
    JobConf conf = new JobConf();
    conf.set(JTConfig.JT_IPC_ADDRESS, "localhost:0");
    conf.set(JTConfig.JT_HTTP_ADDRESS, "0.0.0.0:0");
    conf.setLong(JTConfig.JT_TRACKER_EXPIRY_INTERVAL, 1000);
    jobTracker = new FakeJobTracker(conf, (clock = new FakeClock()), trackers);
  }
View Full Code Here

    // test identifier
    assertEquals(12, jt.getTrackerIdentifier().length()); // correct upto mins
    jt.stopTracker();
   
    // test with special clock
    FakeClock myClock = new FakeClock();
    jt = JobTracker.startTracker(conf, myClock);
    c = JobTracker.getClock();
    assertNotNull(c);
    assertEquals(c, myClock);
    jt.stopTracker();
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.UtilsForTests.FakeClock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.