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


Java MapReduceTestUtil.createCopyJob方法代码示例

本文整理汇总了Java中org.apache.hadoop.mapreduce.MapReduceTestUtil.createCopyJob方法的典型用法代码示例。如果您正苦于以下问题:Java MapReduceTestUtil.createCopyJob方法的具体用法?Java MapReduceTestUtil.createCopyJob怎么用?Java MapReduceTestUtil.createCopyJob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.mapreduce.MapReduceTestUtil的用法示例。


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

示例1: testControlledJob

import org.apache.hadoop.mapreduce.MapReduceTestUtil; //导入方法依赖的package包/类
@Test(timeout = 30000)
public void testControlledJob() throws Exception {
  LOG.info("Starting testControlledJob");

  Configuration conf = createJobConf();
  cleanupData(conf);
  Job job1 = MapReduceTestUtil.createCopyJob(conf, outdir_1, indir);
  JobControl theControl = createDependencies(conf, job1);
  while (cjob1.getJobState() != ControlledJob.State.RUNNING) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {
      break;
    }
  }
  Assert.assertNotNull(cjob1.getMapredJobId());

  // wait till all the jobs complete
  waitTillAllFinished(theControl);
  assertEquals("Some jobs failed", 0, theControl.getFailedJobList().size());
  theControl.stop();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:TestMapReduceJobControl.java

示例2: createDependencies

import org.apache.hadoop.mapreduce.MapReduceTestUtil; //导入方法依赖的package包/类
/**
 * This is a main function for testing JobControl class.
 * It requires 4 jobs: 
 *      Job 1: passed as parameter. input:indir  output:outdir_1
 *      Job 2: copy data from indir to outdir_2
 *      Job 3: copy data from outdir_1 and outdir_2 to outdir_3
 *      Job 4: copy data from outdir to outdir_4
 * The jobs 1 and 2 have no dependency. The job 3 depends on jobs 1 and 2.
 * The job 4 depends on job 3.
 * 
 * Then it creates a JobControl object and add the 4 jobs to 
 * the JobControl object.
 * Finally, it creates a thread to run the JobControl object
 */
private JobControl createDependencies(Configuration conf, Job job1) 
    throws Exception {
  List<ControlledJob> dependingJobs = null;
  cjob1 = new ControlledJob(job1, dependingJobs);
  Job job2 = MapReduceTestUtil.createCopyJob(conf, outdir_2, indir);
  cjob2 = new ControlledJob(job2, dependingJobs);

  Job job3 = MapReduceTestUtil.createCopyJob(conf, outdir_3, 
                                  outdir_1, outdir_2);
  dependingJobs = new ArrayList<ControlledJob>();
  dependingJobs.add(cjob1);
  dependingJobs.add(cjob2);
  cjob3 = new ControlledJob(job3, dependingJobs);

  Job job4 = MapReduceTestUtil.createCopyJob(conf, outdir_4, outdir_3);
  dependingJobs = new ArrayList<ControlledJob>();
  dependingJobs.add(cjob3);
  cjob4 = new ControlledJob(job4, dependingJobs);

  JobControl theControl = new JobControl("Test");
  theControl.addJob(cjob1);
  theControl.addJob(cjob2);
  theControl.addJob(cjob3);
  theControl.addJob(cjob4);
  Thread theController = new Thread(theControl);
  theController.start();
  return theControl;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:43,代码来源:TestMapReduceJobControl.java

示例3: createDependencies

import org.apache.hadoop.mapreduce.MapReduceTestUtil; //导入方法依赖的package包/类
/**
 * This is a main function for testing JobControl class.
 * It requires 4 jobs: 
 *      Job 1: passed as parameter. input:indir  output:outdir_1
 *      Job 2: copy data from indir to outdir_2
 *      Job 3: copy data from outdir_1 and outdir_2 to outdir_3
 *      Job 4: copy data from outdir to outdir_4
 * The jobs 1 and 2 have no dependency. The job 3 depends on jobs 1 and 2.
 * The job 4 depends on job 3.
 * 
 * Then it creates a JobControl object and add the 4 jobs to 
 * the JobControl object.
 * Finally, it creates a thread to run the JobControl object
 */
private JobControl createDependencies(Configuration conf, Job job1) 
    throws Exception {
  ArrayList<ControlledJob> dependingJobs = null;
  cjob1 = new ControlledJob(job1, dependingJobs);
  Job job2 = MapReduceTestUtil.createCopyJob(conf, outdir_2, indir);
  cjob2 = new ControlledJob(job2, dependingJobs);

  Job job3 = MapReduceTestUtil.createCopyJob(conf, outdir_3, 
                                  outdir_1, outdir_2);
  dependingJobs = new ArrayList<ControlledJob>();
  dependingJobs.add(cjob1);
  dependingJobs.add(cjob2);
  cjob3 = new ControlledJob(job3, dependingJobs);

  Job job4 = MapReduceTestUtil.createCopyJob(conf, outdir_4, outdir_3);
  dependingJobs = new ArrayList<ControlledJob>();
  dependingJobs.add(cjob3);
  cjob4 = new ControlledJob(job4, dependingJobs);

  JobControl theControl = new JobControl("Test");
  theControl.addJob(cjob1);
  theControl.addJob(cjob2);
  theControl.addJob(cjob3);
  theControl.addJob(cjob4);
  Thread theController = new Thread(theControl);
  theController.start();
  return theControl;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:43,代码来源:TestMapReduceJobControl.java

示例4: testControlledJob

import org.apache.hadoop.mapreduce.MapReduceTestUtil; //导入方法依赖的package包/类
@Test(timeout = 30000)
public void testControlledJob() throws Exception {
  Configuration conf = createJobConf();
  cleanupData(conf);
  Job job1 = MapReduceTestUtil.createCopyJob(conf, outdir_1, indir);
  createDependencies(conf, job1);
  while (cjob1.getJobState() != ControlledJob.State.RUNNING) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {
      break;
    }
  }
  Assert.assertNotNull(cjob1.getMapredJobId());
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:16,代码来源:TestMapReduceJobControl.java

示例5: testJobControl

import org.apache.hadoop.mapreduce.MapReduceTestUtil; //导入方法依赖的package包/类
public void testJobControl() throws Exception {
  LOG.info("Starting testJobControl");

  Configuration conf = createJobConf();

  cleanupData(conf);
  
  Job job1 = MapReduceTestUtil.createCopyJob(conf, outdir_1, indir);
  
  JobControl theControl = createDependencies(conf, job1);
  
  // wait till all the jobs complete
  waitTillAllFinished(theControl);
  
  assertEquals("Some jobs failed", 0, theControl.getFailedJobList().size());
  
  theControl.stop();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestMapReduceJobControl.java

示例6: testJobControl

import org.apache.hadoop.mapreduce.MapReduceTestUtil; //导入方法依赖的package包/类
public void testJobControl() throws Exception {
  Configuration conf = createJobConf();

  cleanupData(conf);
  
  Job job1 = MapReduceTestUtil.createCopyJob(conf, outdir_1, indir);
  
  JobControl theControl = createDependencies(conf, job1);
  
  // wait till all the jobs complete
  waitTillAllFinished(theControl);
  
  assertEquals("Some jobs failed", 0, theControl.getFailedJobList().size());
  
  theControl.stop();
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:17,代码来源:TestMapReduceJobControl.java

示例7: testJobControl

import org.apache.hadoop.mapreduce.MapReduceTestUtil; //导入方法依赖的package包/类
@Test
public void testJobControl() throws Exception {
  LOG.info("Starting testJobControl");

  Configuration conf = createJobConf();

  cleanupData(conf);
  
  Job job1 = MapReduceTestUtil.createCopyJob(conf, outdir_1, indir);
  
  JobControl theControl = createDependencies(conf, job1);
  
  // wait till all the jobs complete
  waitTillAllFinished(theControl);
  
  assertEquals("Some jobs failed", 0, theControl.getFailedJobList().size());
  
  theControl.stop();
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:20,代码来源:TestMapReduceJobControl.java


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