当前位置: 首页>>代码示例>>Java>>正文


Java MockSimulatorEngine类代码示例

本文整理汇总了Java中org.apache.hadoop.mapred.MockSimulatorEngine的典型用法代码示例。如果您正苦于以下问题:Java MockSimulatorEngine类的具体用法?Java MockSimulatorEngine怎么用?Java MockSimulatorEngine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MockSimulatorEngine类属于org.apache.hadoop.mapred包,在下文中一共展示了MockSimulatorEngine类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testMain

import org.apache.hadoop.mapred.MockSimulatorEngine; //导入依赖的package包/类
@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);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:22,代码来源:TestSimulatorEndToEnd.java

示例2: testMain

import org.apache.hadoop.mapred.MockSimulatorEngine; //导入依赖的package包/类
@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);
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:26,代码来源:TestSimulatorEndToEnd.java


注:本文中的org.apache.hadoop.mapred.MockSimulatorEngine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。