【发布时间】:2015-12-11 09:22:48
【问题描述】:
我正在使用 Multioutputformat 类运行 MR 代码。 part**** 被附加到我的输出文件的末尾。我该如何避免呢?
公共类 MR_reducer 扩展 减速器{
private MultipleOutputs multipleOutputs;
@Override
protected void setup(Context context) throws IOException,
InterruptedException {
multipleOutputs = new MultipleOutputs(context);
}
@Override
protected void reduce(Text key, Iterable<Text> values, Context context)
throws IOException, InterruptedException {
for (Text value : values) {
multipleOutputs.write(value, new Text(""), key.toString());
}
}
@Override
protected void cleanup(Context context) throws IOException,
InterruptedException {
multipleOutputs.close();
}
}
【问题讨论】:
标签: hadoop mapreduce multipleoutputs