Class ShardedPartitioner

  • All Implemented Interfaces:
    Partitioner

    @Internal
    public final class ShardedPartitioner
    extends java.lang.Object
    implements Partitioner
    Sharded Partitioner

    Uses the chunks collection and partitions the collection based on the sharded collections chunk ranges.

    Note: Does not support collections sharded using hashed shard keys or compound shard keys.

    • Field Summary

      • Fields inherited from interface com.mongodb.spark.sql.connector.read.partitioner.Partitioner

        LOGGER
    • Constructor Summary

      Constructors 
      Constructor Description
      ShardedPartitioner()
      Construct an instance
    • Constructor Detail

      • ShardedPartitioner

        public ShardedPartitioner()
        Construct an instance
    • Method Detail

      • generatePartitions

        public java.util.List<MongoInputPartition> generatePartitions​(ReadConfig readConfig)
        Description copied from interface: Partitioner
        Generate the partitions for the collection based upon the read configuration
        Specified by:
        generatePartitions in interface Partitioner
        Parameters:
        readConfig - the read configuration
        Returns:
        the partitions