Class MongoPartitionReader

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes this stream and releases any system resources associated with it.
      org.apache.spark.sql.catalyst.InternalRow get()
      Return the current record.
      boolean next()
      Proceed to next record, returns false if there is no more records.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MongoPartitionReader

        public MongoPartitionReader​(MongoInputPartition partition,
                                    BsonDocumentToRowConverter bsonDocumentToRowConverter,
                                    ReadConfig readConfig)
        Construct a new instance
        Parameters:
        partition - the partition
        bsonDocumentToRowConverter - the converter from BsonDocument to InternalRow
        readConfig - the read configuration for reading from the partition
    • Method Detail

      • next

        public boolean next()
        Proceed to next record, returns false if there is no more records.
        Specified by:
        next in interface PartitionReader<org.apache.spark.sql.catalyst.InternalRow>
      • get

        public org.apache.spark.sql.catalyst.InternalRow get()
        Return the current record. This method should return same value until `next` is called.
        Specified by:
        get in interface PartitionReader<org.apache.spark.sql.catalyst.InternalRow>
      • close

        public void close()
        Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable