求助,关于多线程同时运行多个hadoop MapReduceJob的问题
1个回答
展开全部
Configuration conf = new Configuration();
Job job = new Job(conf);
job.setJobName("ChianJOb");
// 在ChainMapper里面添加Map1
Configuration map1conf = new Configuration(false);
ChainMapper.addMapper(job, Map1.class, LongWritable.class, Text.class,
Text.class, Text.class, true, map1conf);
// 在ChainReduce中加入Reducer,Map2;
Configuration reduceConf = new Configuration(false);
ChainReducer.setReducer(job, Reduce.class, LongWritable.class,
Text.class, Text.class, Text.class, true, map1conf);
Configuration map2Conf = new Configuration();
ChainReducer.addMapper(job, Map2.class, LongWritable.class, Text.class,
Text.class, Text.class, true, map1conf);
job.waitForCompletion(true);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询