HashPartitionResolver 类

定义

HashPartitionResolver implements partitioning based on the value of a hash function, allowing you to evenly distribute requests and data across a number of partitions by implementing PartitionResolver interface in the Azure Cosmos DB database service.

public class HashPartitionResolver implements PartitionResolver
继承
java.lang.Object
HashPartitionResolver

构造函数

HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable<String> collectionLinks)

HashPartitionResolver constructor taking in the PartitionKeyExtractor and collection links with default number of virtual nodes per collection(128) and default hash generator(MurmurHash3)

HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable<String> collectionLinks, HashGenerator hashGenerator)

HashPartitionResolver constructor taking in the PartitionKeyExtractor, collection Links, hash generator with default number of virtual nodes per collection(128)

HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable<String> collectionLinks, int numberOfVirtualNodesPerCollection)

HashPartitionResolver constructor taking in the PartitionKeyExtractor, collection Links, number of virtual nodes per collection and default hash generator(MurmurHash3)

HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable<String> collectionLinks, int numberOfVirtualNodesPerCollection, HashGenerator hashGenerator)

HashPartitionResolver constructor taking in the PartitionKeyExtractor, collection Links, hash generator and number of virtual nodes per collection

方法

resolveForCreate(Object document)

Resolves the collection for creating the document based on the partition key.

resolveForRead(Object partitionKey)

Resolves the collection for reading/querying the documents based on the partition key.

适用于