我正在处理Map Reduce作业,并且需要保存要在Map / Reduce完成后进行比较的对象。必须以某种方式从Mapper返回并收集该对象。一项工作创建一个对象。我需要收集对象并将它们存储在数组中,以便在MapReduce作业完成后进行处理。
在每个映射器完成之后,如何返回对象或至少一个字符串?
正在初始化课程...
public class Metrics {
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
conf.set("mapred.textoutputformat.separator", ",");
Job job = new Job(conf, "Document Word Size");
job.setJarByClass(Metrics.class);
job.setMapperClass(MetricsMapper.class);
job.setReducerClass(MetricsReducer.class);
job.setOutputKeyClass(Text.class);
job.waitForCompletion(true); // Submit the job
//---Here--- somehow get the result of each job and store the value for my next step of processing.
}
}