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 BatchWrite
buildForBatch()
Returns aMongoBatchWrite
to write data to batch source.StreamingWrite
buildForStreaming()
Returns aMongoStreamingWrite
to write data to streaming source.WriteBuilder
truncate()
-
-
-
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 aMongoBatchWrite
to write data to batch source.- Specified by:
buildForBatch
in interfaceWriteBuilder
-
buildForStreaming
public StreamingWrite buildForStreaming()
Returns aMongoStreamingWrite
to write data to streaming source.- Specified by:
buildForStreaming
in interfaceWriteBuilder
-
truncate
public WriteBuilder truncate()
- Specified by:
truncate
in interfaceSupportsTruncate
- Returns:
- a MongoWriteBuilder where truncate is set to true.
-
-