Class MongoWriteBuilder
- java.lang.Object
-
- com.mongodb.spark.sql.connector.write.MongoWriteBuilder
-
- All Implemented Interfaces:
SupportsTruncate,WriteBuilder
@Internal public class MongoWriteBuilder extends java.lang.Object implements WriteBuilder, SupportsTruncate
MongoWriteBuilder handles the creation of batch writer or streaming writers.
-
-
Constructor Summary
Constructors Constructor Description MongoWriteBuilder(LogicalWriteInfo info, WriteConfig writeConfig)Construct a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BatchWritebuildForBatch()Returns aMongoBatchWriteto write data to batch source.StreamingWritebuildForStreaming()Returns aMongoStreamingWriteto write data to streaming source.WriteBuildertruncate()
-
-
-
Constructor Detail
-
MongoWriteBuilder
public MongoWriteBuilder(LogicalWriteInfo info, WriteConfig writeConfig)
Construct a new instance- Parameters:
info- the logical write infowriteConfig- the configuration for the write
-
-
Method Detail
-
buildForBatch
public BatchWrite buildForBatch()
Returns aMongoBatchWriteto write data to batch source.- Specified by:
buildForBatchin interfaceWriteBuilder
-
buildForStreaming
public StreamingWrite buildForStreaming()
Returns aMongoStreamingWriteto write data to streaming source.- Specified by:
buildForStreamingin interfaceWriteBuilder
-
truncate
public WriteBuilder truncate()
- Specified by:
truncatein interfaceSupportsTruncate- Returns:
- a MongoWriteBuilder where truncate is set to true.
-
-