Java 类org.apache.hadoop.mapred.MockSimulatorEngine 实例源码

项目:hadoop-EAR    文件:TestSimulatorEndToEnd.java   
@Test
public void testMain() throws Exception {
  final Configuration conf = new Configuration();
  final FileSystem lfs = FileSystem.getLocal(conf);
  final Path rootInputDir = new Path(
      System.getProperty("src.test.data", "data")).makeQualified(lfs);
  final Path traceFile = new Path(rootInputDir, "19-jobs.trace.json.gz");
  final Path topologyFile = new Path(rootInputDir, "19-jobs.topology.json.gz");

  LOG.info("traceFile = " + traceFile.toString() + " topology = "
      + topologyFile.toString());

  int numJobs = getNumberJobs(traceFile, conf);
  int nTrackers = getNumberTaskTrackers(topologyFile, conf);

  MockSimulatorEngine mockMumak = new MockSimulatorEngine(numJobs, nTrackers);

  String[] args = { traceFile.toString(), topologyFile.toString() };
  int res = ToolRunner.run(new Configuration(), mockMumak, args);
  Assert.assertEquals(res, 0);
}
项目:RDFS    文件:TestSimulatorEndToEnd.java   
@Test
public void testMain() throws Exception {
  final Configuration conf = new Configuration();
  final FileSystem lfs = FileSystem.getLocal(conf);
  final Path rootInputDir = new Path(
      System.getProperty("src.test.data", "data")).makeQualified(lfs);
  final Path traceFile = new Path(rootInputDir, "19-jobs.trace.json.gz");
  final Path topologyFile = new Path(rootInputDir, "19-jobs.topology.json.gz");

  LOG.info("traceFile = " + traceFile.toString() + " topology = "
      + topologyFile.toString());

  int numJobs = getNumberJobs(traceFile, conf);
  int nTrackers = getNumberTaskTrackers(topologyFile, conf);

  MockSimulatorEngine mockMumak = new MockSimulatorEngine(numJobs, nTrackers);

  String[] args = { traceFile.toString(), topologyFile.toString() };
  int res = ToolRunner.run(new Configuration(), mockMumak, args);
  Assert.assertEquals(res, 0);
}
项目:mapreduce-fork    文件:TestSimulatorEndToEnd.java   
@Test
public void testMain() throws Exception {
  final Configuration conf = new Configuration();
  conf.set(SimulatorJobSubmissionPolicy.JOB_SUBMISSION_POLICY, policy.name());
  final FileSystem lfs = FileSystem.getLocal(conf);
  final Path rootInputDir = new Path(
      System.getProperty("src.test.data", "data")).makeQualified(lfs);
  final Path traceFile = new Path(rootInputDir, "19-jobs.trace.json.gz");
  final Path topologyFile = new Path(rootInputDir, "19-jobs.topology.json.gz");

  LOG.info("traceFile = " + traceFile.toString() + " topology = "
      + topologyFile.toString());

  int numJobs = getNumberJobs(traceFile, conf);
  int nTrackers = getNumberTaskTrackers(topologyFile, conf);

  MockSimulatorEngine mockMumak = new MockSimulatorEngine(numJobs, nTrackers);

  Configuration mumakConf = new Configuration();
  mumakConf.set("mapred.jobtracker.taskScheduler", JobQueueTaskScheduler.class.getName());
  mumakConf.setBoolean(JTConfig.JT_PERSIST_JOBSTATUS, false);
  String[] args = { traceFile.toString(), topologyFile.toString() };
  int res = ToolRunner.run(mumakConf, mockMumak, args);
  Assert.assertEquals(res, 0);
}