code: public static Class<? extends CompressionCodec> 
    getOutputCompressorClass(JobContext job, 
  		                       Class<? extends CompressionCodec> defaultValue) {
      Class<? extends CompressionCodec> codecClass = defaultValue;
      Configuration conf = job.getConfiguration();
      String name = conf.get("mapred.output.compression.codec");
      if (name != null) {
        try {
          codecClass = 
          	conf.getClassByName(name).asSubclass(CompressionCodec.class);
        } catch (ClassNotFoundException e) {
          throw new IllegalArgumentException("Compression codec " + name + 
                                             " was not found.", e);
        }
      }
      return codecClass;
    }
docs: Get the {@link CompressionCodec} for compressing the job outputs.
  @param job the {@link Job} to look in
  @param defaultValue the {@link CompressionCodec} to return if not set
  @return the {@link CompressionCodec} to be used to compress the
  job outputs
  @throws IllegalArgumentException if the class was specified, but not found