[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
courses:mapreduce-tutorial:step-26 [2012/01/28 20:21]
straka
courses:mapreduce-tutorial:step-26 [2012/01/28 20:26]
straka
Line 24: Line 24:
  
 ===== Compression ===== ===== Compression =====
 +
 +The output files can be compressed using
 +<code java>
 +  FileOutputFormat.setCompressOutput(job, true);
 +</code>
 +  
 +The default compression format is ''deflate'' -- raw Zlib compression. Several other compression formats can be selected:
 +<code java>
 +import org.apache.hadoop.io.compress.*;
 +
 +  ...
 +  FileOutputFormat.setOutputCompressorClass(GzipCodec.class);   //.gz
 +  FileOutputFormat.setOutputCompressorClass(BZip2Codec.class);  //.bz2
 +</code>
 +
 +Of course, any of these formats is decompressed transparently when the file is being read.
  
 ===== Job configuration ===== ===== Job configuration =====

[ Back to the navigation ] [ Back to the content ]