Class MongoStreamPartitionReaderFactory
- java.lang.Object
-
- com.mongodb.spark.sql.connector.read.MongoStreamPartitionReaderFactory
-
- All Implemented Interfaces:
java.io.Serializable
,PartitionReaderFactory
,ContinuousPartitionReaderFactory
public final class MongoStreamPartitionReaderFactory extends java.lang.Object implements ContinuousPartitionReaderFactory
A factory used to createMongoStreamPartitionReader
instances.Utilizes MongoDBs change stream functionality, the continuous streams will consist of change events.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MongoStreamPartitionReaderFactory(BsonDocumentToRowConverter bsonDocumentToRowConverter, ReadConfig readConfig)
Construct a new instance for a continuous stream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContinuousPartitionReader<org.apache.spark.sql.catalyst.InternalRow>
createReader(InputPartition partition)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.spark.sql.connector.read.streaming.ContinuousPartitionReaderFactory
createColumnarReader
-
Methods inherited from interface org.apache.spark.sql.connector.read.PartitionReaderFactory
supportColumnarReads
-
-
-
-
Constructor Detail
-
MongoStreamPartitionReaderFactory
public MongoStreamPartitionReaderFactory(BsonDocumentToRowConverter bsonDocumentToRowConverter, ReadConfig readConfig)
Construct a new instance for a continuous stream- Parameters:
bsonDocumentToRowConverter
- the bson document to internal row converterreadConfig
- the read configuration
-
-
Method Detail
-
createReader
public ContinuousPartitionReader<org.apache.spark.sql.catalyst.InternalRow> createReader(InputPartition partition)
- Specified by:
createReader
in interfaceContinuousPartitionReaderFactory
- Specified by:
createReader
in interfacePartitionReaderFactory
-
-