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

com.marklogic.spark.writer.MarkLogicWriteBuilder 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;

import org.apache.spark.sql.connector.write.BatchWrite;
import org.apache.spark.sql.connector.write.Write;
import org.apache.spark.sql.connector.write.WriteBuilder;
import org.apache.spark.sql.connector.write.streaming.StreamingWrite;

public class MarkLogicWriteBuilder implements WriteBuilder {

    private WriteContext writeContext;

    public MarkLogicWriteBuilder(WriteContext writeContext) {
        this.writeContext = writeContext;
    }

    @Override
    public Write build() {
        return new Write() {
            @Override
            public BatchWrite toBatch() {
                return new MarkLogicWrite(writeContext);
            }

            @Override
            public StreamingWrite toStreaming() {
                return new MarkLogicWrite(writeContext);
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy