format/src/main/java/com/github/sadikovi/riff/Riff.java
/**
   * Get new writer.
   * Compression codec, if not set, is inferred from the file path.
   * @param fs file system to use
   * @param conf configuration with Riff options
   * @param path path to write
   * @param td type description (schema)
   * @return file writer
   */
Get new writer.
Compression codec, if not set, is inferred from the file path.
Get new writer . Compression codec if not set is inferred from the file path .
public static FileWriter writer(
      FileSystem fs,
      Configuration conf,
      Path path,
      TypeDescription td) {
    CompressionCodec codec;
    if (Options.compressionCodecName(conf) != null) {
      codec = CompressionCodecFactory.forShortName(Options.compressionCodecName(conf));
    } else {
      codec = inferCompressionCodec(path);
    }
    try {
      return new FileWriter(fs, conf, path, td, codec);
    } catch (IOException err) {
      throw new RuntimeException("Error occured: " + err.getMessage(), err);
    }
  }
public static FileWriter writer ( FileSystem fs , Configuration conf , Path path , TypeDescription td ) { CompressionCodec codec ; if ( Options . compressionCodecName ( conf ) != null ) { codec = CompressionCodecFactory . forShortName ( Options . compressionCodecName ( conf ) ) ; } else { codec = inferCompressionCodec ( path ) ; } try { return new FileWriter ( fs , conf , path , td , codec ) ; } catch ( IOException err ) { throw new RuntimeException ( "Error occured: " + err . getMessage ( ) , err ) ; } }
Get new writer.
Get new writer .
// check if compression codec is set in configuration, otherwise fall back to the inferring // codec from file extension