Class MongoStreamingWrite
- java.lang.Object
-
- com.mongodb.spark.sql.connector.write.MongoStreamingWrite
-
- All Implemented Interfaces:
StreamingWrite
public class MongoStreamingWrite extends java.lang.Object implements StreamingWrite
MongoStreamingWrite defines how to write the data to MongoDB when streaming data.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort(long epochId, WriterCommitMessage[] messages)The write was aborted due to a failure.voidcommit(long epochId, WriterCommitMessage[] messages)Logs the that the write has been committedStreamingDataWriterFactorycreateStreamingWriterFactory(PhysicalWriteInfo info)Creates the MongoDataWriterFactory instance will be serialized and sent to executors.
-
-
-
Method Detail
-
createStreamingWriterFactory
public StreamingDataWriterFactory createStreamingWriterFactory(PhysicalWriteInfo info)
Creates the MongoDataWriterFactory instance will be serialized and sent to executors.- Specified by:
createStreamingWriterFactoryin interfaceStreamingWrite- Parameters:
info- Physical information about the input data that will be written to this table.
-
commit
public void commit(long epochId, WriterCommitMessage[] messages)Logs the that the write has been committed- Specified by:
commitin interfaceStreamingWrite- Parameters:
epochId- the epoch id for the writemessages- WriterCommitMessages
-
abort
public void abort(long epochId, WriterCommitMessage[] messages)The write was aborted due to a failure.There is no automatic clean up, so the database state is undetermined.
- Specified by:
abortin interfaceStreamingWrite- Parameters:
epochId- the epoch id for the writemessages- the WriterCommitMessages- Throws:
DataException- with information regarding the failed write
-
-