com.marklogic.spark.writer.file.GzipFileWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marklogic-spark-connector Show documentation
Show all versions of marklogic-spark-connector Show documentation
Spark 3 connector for MarkLogic
/*
* Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
*/
package com.marklogic.spark.writer.file;
import org.apache.hadoop.fs.Path;
import org.apache.spark.util.SerializableConfiguration;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.zip.GZIPOutputStream;
class GzipFileWriter extends DocumentFileWriter {
GzipFileWriter(Map properties, SerializableConfiguration hadoopConfiguration) {
super(properties, hadoopConfiguration);
}
@Override
protected String makeFilePath(String uri) {
return super.makeFilePath(uri) + ".gz";
}
@Override
protected OutputStream makeOutputStream(Path path) throws IOException {
return new GZIPOutputStream(super.makeOutputStream(path));
}
}