类org.apache.hadoop.mapreduce.lib.chain.ChainReducer源码实例Demo

下面列出了怎么用org.apache.hadoop.mapreduce.lib.chain.ChainReducer的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: MLHadoop   文件: lud_driver.java
public static void prepareJobWithConf (Job jobPrep, Configuration confPrep) throws IOException, InterruptedException, ClassNotFoundException {
	
	long n = confPrep.getLong("n", 0);
	
	// Chaining MR Jobs
	if (n == 0) {
		ChainMapper.addMapper(jobPrep, initial_input_mapper.class,
				Text.class, Text.class,
				Text.class, Text.class,
				confPrep);
		ChainReducer.setReducer(jobPrep, lud_reducer.class, Text.class, Text.class, Text.class, Text.class, confPrep);
	}
	else {
		ChainReducer.addMapper(jobPrep, initial_input_mapper.class,
				Text.class, Text.class,
				Text.class, Text.class,
				confPrep);
		ChainReducer.addMapper(jobPrep, lud_mapper.class,
				Text.class, Text.class,
				Text.class, Text.class,
				confPrep);
	}
}
 
 同包方法