I would like to write compressed and uncrompressed files within the same reducer using MultipleOutputs, but it seems to be an all or nothing. If I do:
MultipleOutputs.addNamedOutput(job, "ToGzip", TextOutputFormat.class, NullWritable.class, Text.class);
TextOutputFormat.setCompressOutput(job, true);
TextOutputFormat.setOutputCompressorClass(job, GzipCodec.class);
It will compress everything, not only the files that I want. If you look at this very similar question:
Hadoop: How to output different format types in the same job?
You will see that it will fix my problem, but it uses the old interface and the new one does not have:
context.getConfiguration().setOutputCompressorClass(GzipCodec.class);
What would be the equivalent solution with the new Hadoop API ?