. MultipleOutputs .
public class YourReducer extends Reducer<Text, Value, Text, Value> {
private Value result = null;
private MultipleOutputs<Text,Value> out;
public void setup(Context context) {
out = new MultipleOutputs<Text,Value>(context);
}
public void reduce(Text key, Iterable<Value> values, Context context)
throws IOException, InterruptedException {
out.write(key, result,"outputpath/"+key.getText());
}
public void cleanup(Context context) throws IOException,InterruptedException {
out.close();
}
}
outputpath/K1
/K2
/K3
.......
LazyOutputFormat.setOutputFormatClass() FileOutputFormat. job.setOutputFormatClass(NullOutputFormat.class). , FileOutputFormat.setOutputPath() FileOutputFormat.setOutputPath(), .