Java 类org.apache.hadoop.mapred.FakeObjectUtilities.FakeJobTracker 实例源码

项目:hadoop-EAR    文件:TestSpeculativeExecution.java   
public static Test suite() {
  TestSetup setup =
    new TestSetup(new TestSuite(TestSpeculativeExecution.class)) {
    @Override
    protected void setUp() throws Exception {
      JobConf conf = new JobConf();
      conf.set(JT_IPC_ADDRESS, "localhost:0");
      conf.set(JT_HTTP_ADDRESS, "0.0.0.0:0");
      jobTracker = new FakeJobTracker
        (conf, (clock = new SpecFakeClock(conf.getMapSpeculativeLag())),
         trackers);
      for (String tracker : trackers) {
        FakeObjectUtilities.establishFirstContact(jobTracker, tracker);
      }
    }
    @Override
    protected void tearDown() throws Exception {
      //delete the build/test/logs/ dir
    }
  };
  return setup;
}
项目:RDFS    文件:TestSpeculativeExecution.java   
public static Test suite() {
  TestSetup setup =
    new TestSetup(new TestSuite(TestSpeculativeExecution.class)) {
    @Override
    protected void setUp() throws Exception {
      JobConf conf = new JobConf();
      conf.set(JT_IPC_ADDRESS, "localhost:0");
      conf.set(JT_HTTP_ADDRESS, "0.0.0.0:0");
      jobTracker = new FakeJobTracker
        (conf, (clock = new SpecFakeClock(conf.getMapSpeculativeLag())),
         trackers);
      for (String tracker : trackers) {
        FakeObjectUtilities.establishFirstContact(jobTracker, tracker);
      }
    }
    @Override
    protected void tearDown() throws Exception {
      //delete the build/test/logs/ dir
    }
  };
  return setup;
}
项目:mapreduce-fork    文件:TestRackAwareTaskPlacement.java   
public static Test suite() {
  TestSetup setup = 
    new TestSetup(new TestSuite(TestRackAwareTaskPlacement.class)) {
    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.setClass("topology.node.switch.mapping.impl", 
        StaticMapping.class, DNSToSwitchMapping.class);
      conf.set(JTConfig.JT_INSTRUMENTATION,
          FakeJobTrackerMetricsInst.class.getName());
      jobTracker = new FakeJobTracker(conf, new FakeClock(), trackers);
      fakeInst = (FakeJobTrackerMetricsInst) jobTracker.getInstrumentation();
      // Set up the Topology Information
      for (int i = 0; i < allHosts.length; i++) {
        StaticMapping.addNodeToRack(allHosts[i], allRacks[i]);
      }
      for (String tracker : trackers) {
        FakeObjectUtilities.establishFirstContact(jobTracker, tracker);
      }
    }
  };
  return setup;
}
项目:mapreduce-fork    文件:TestSpeculativeExecution.java   
public static Test suite() {
  TestSetup setup = 
    new TestSetup(new TestSuite(TestSpeculativeExecution.class)) {
    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.set(JTConfig.JT_INSTRUMENTATION,
          FakeJobTrackerMetricsInst.class.getName());
      jobTracker = new FakeJobTracker(conf, (clock = new SpecFakeClock()),
          trackers);
      fakeInst = (FakeJobTrackerMetricsInst) jobTracker.getInstrumentation();
      for (String tracker : trackers) {
        FakeObjectUtilities.establishFirstContact(jobTracker, tracker);
      }
    }
    protected void tearDown() throws Exception {
      //delete the build/test/logs/ dir
    }
  };
  return setup;
}
项目:mapreduce-fork    文件:TestJobInProgress.java   
public static Test suite() {
  TestSetup setup = new TestSetup(new TestSuite(TestJobInProgress.class)) {
    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.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) {
        FakeObjectUtilities.establishFirstContact(jobTracker, s);
      }
    }
  };
  return setup;
}
项目:mapreduce-fork    文件:TestSetupTaskScheduling.java   
public 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");
  jobTracker = new FakeJobTracker(conf, new Clock(), trackers);
  for (String tracker : trackers) {
    FakeObjectUtilities.establishFirstContact(jobTracker, tracker);
  }
}
项目:mapreduce-fork    文件:TestLostTracker.java   
@Override
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);
  conf.set(JTConfig.JT_MAX_TRACKER_BLACKLISTS, "1");
  jobTracker = new FakeJobTracker(conf, (clock = new FakeClock()), trackers);
  jobTracker.startExpireTrackersThread();
}
项目:mapreduce-fork    文件:TestKillCompletedJob.java   
@Override
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);
}