Class MongoPartitionReaderFactory
- java.lang.Object
-
- com.mongodb.spark.sql.connector.read.MongoPartitionReaderFactory
-
- All Implemented Interfaces:
java.io.Serializable
,PartitionReaderFactory
public class MongoPartitionReaderFactory extends java.lang.Object implements PartitionReaderFactory, java.io.Serializable
A factory used to createMongoPartitionReader
instances.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MongoPartitionReaderFactory(BsonDocumentToRowConverter bsonDocumentToRowConverter, ReadConfig readConfig)
Construct a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PartitionReader<org.apache.spark.sql.catalyst.InternalRow>
createReader(InputPartition partition)
Returns a row-based partition reader to read data from the givenMongoInputPartition
.-
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.PartitionReaderFactory
createColumnarReader, supportColumnarReads
-
-
-
-
Constructor Detail
-
MongoPartitionReaderFactory
public MongoPartitionReaderFactory(BsonDocumentToRowConverter bsonDocumentToRowConverter, ReadConfig readConfig)
Construct a new instance- Parameters:
bsonDocumentToRowConverter
- the bson document to internal row converterreadConfig
- the read configuration
-
-
Method Detail
-
createReader
public PartitionReader<org.apache.spark.sql.catalyst.InternalRow> createReader(InputPartition partition)
Returns a row-based partition reader to read data from the givenMongoInputPartition
.- Specified by:
createReader
in interfacePartitionReaderFactory
- Parameters:
partition
- the input partition information
-
-