All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.marklogic.spark.writer.file.GzipFileWriter Maven / Gradle / Ivy

There is a newer version: 2.4.2
Show newest version
/*
 * 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));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy