MongoPaginateByCountPartitioner

本文详细介绍了MongoDB Spark RDD中的MongoPaginateByCountPartitioner类,它通过计数进行集合分页,将集合分割成指定数量的最大分区。文章讨论了配置属性,如partitionKey和numberOfPartitions,并说明了其在MongoDB输入操作中的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Class/Object

com.mongodb.spark.rdd.partitioner
MongoPaginateByCountPartitioner
Related Docs: object MongoPaginateByCountPartitioner | package partitioner
Permalink
class MongoPaginateByCountPartitioner extends Logging with MongoPartitioner with MongoPaginationPartitioner

The pagination by count partitioner.

Paginates the collection into a maximum number of partitions.
Configuration Properties

The prefix when using sparkConf is: spark.mongodb.input.partitionerOptions followed by the property name:

partitionKey, the field to partition the collection by. The field should be indexed and contain unique values. Defaults to _id.
numberOfPartitions, the maximum number of partitions to create. Defaults to 64.

Note: This can be a expensive operation as it creates 1 cursor for every partition.

Since

1.0

Linear Supertypes
Known Subclasses
Ordering

Alphabetic
By Inheritance

Inherited

MongoPaginateByCountPartitioner
MongoPaginationPartitioner
MongoPartitioner
Serializable
Serializable
Logging
LoggingTrait
AnyRef
Any

Hide All
Show All

Visibility

Public
All

Instance Constructors

new MongoPaginateByCountPartitioner()

Value Members

val numberOfPartitionsProperty: String

The number of partitions property
val partitionKeyProperty: String

The partition key property
def partitions(connector: MongoConnector, readConfig: ReadConfig, pipeline: Array[BsonDocument]): Array[MongoPartition]

Calculate the Partitions
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值