get rid of hard coded compression codec name
@@ -101,11 +101,13 @@ public class AvroParquetFileReaderWriterFactory implements FileReaderWriterFacto
public AvroParquetFileWriter(LogFilePath logFilePath, CompressionCodec codec) throws IOException {
Path path = new Path(logFilePath.getLogFilePath());
LOG.info("Creating Brand new Writer for path {}", path);
+ CompressionCodecName codecName = CompressionCodecName
+ .fromCompressionCodec(codec != null ? codec.getClass() : null);
topic = logFilePath.getTopic();
// Not setting blockSize, pageSize, enableDictionary, and validating
writer = AvroParquetWriter.builder(path)
.withSchema(schemaRegistryClient.getSchema(topic))
- .withCompressionCodec(CompressionCodecName.GZIP)
+ .withCompressionCodec(codecName)
.build();
}
