下面列出了怎么用org.apache.hadoop.mapreduce.lib.chain.ChainReducer的API类实例代码及写法,或者点击链接到github查看源代码。
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);
}
}