code: private static Writer
    createWriter(FileSystem fs, Configuration conf, Path file, 
                 Class keyClass, Class valClass, 
                 boolean compress, boolean blockCompress,
                 CompressionCodec codec, Progressable progress, Metadata metadata)
    throws IOException {
    if (codec != null && (codec instanceof GzipCodec) && 
        !NativeCodeLoader.isNativeCodeLoaded() && 
        !ZlibFactory.isNativeZlibLoaded(conf)) {
      throw new IllegalArgumentException("SequenceFile doesn't work with " +
                                         "GzipCodec without native-hadoop code!");
    }
  
    Writer writer = null;
  
    if (!compress) {
      writer = new Writer(fs, conf, file, keyClass, valClass, progress, metadata);
    } else if (compress && !blockCompress) {
      writer = new RecordCompressWriter(fs, conf, file, keyClass, valClass, 
                                        codec, progress, metadata);
    } else {
      writer = new BlockCompressWriter(fs, conf, file, keyClass, valClass, 
                                       codec, progress, metadata);
    }
    
    return writer;
  }
docs: Construct the preferred type of 'raw' SequenceFile Writer.
  @param fs The configured filesystem.
  @param conf The configuration.
  @param file The name of the file.
  @param keyClass The 'key' type.
  @param valClass The 'value' type.
  @param compress Compress data?
  @param blockCompress Compress blocks?
  @param codec The compression codec.
  @param progress
  @param metadata The metadata of the file.
  @return Returns the handle to the constructed SequenceFile Writer.
  @throws IOException