HashPartitionResolver Class
- java.
lang. Object - com.
microsoft. azure. documentdb. HashPartitionResolver
- com.
Implements
public class HashPartitionResolver
implements PartitionResolver
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.
Constructor Summary
Constructor | Description |
---|---|
HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable<String> collectionLinks) |
Hash |
HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable<String> collectionLinks, HashGenerator hashGenerator) |
Hash |
HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable<String> collectionLinks, int numberOfVirtualNodesPerCollection) |
Hash |
HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable<String> collectionLinks, int numberOfVirtualNodesPerCollection, HashGenerator hashGenerator) |
Hash |
Method Summary
Modifier and Type | Method and Description |
---|---|
java.lang.String |
resolveForCreate(Object document)
Resolves the collection for creating the document based on the partition key. |
java.lang.Iterable<java.lang.String> |
resolveForRead(Object partitionKey)
Resolves the collection for reading/querying the documents based on the partition key. |
Methods inherited from java.lang.Object
Constructor Details
HashPartitionResolver
public HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable
HashPartitionResolver constructor taking in the PartitionKeyExtractor and collection links with default number of virtual nodes per collection(128) and default hash generator(MurmurHash3)
Parameters:
HashPartitionResolver
public HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable
HashPartitionResolver constructor taking in the PartitionKeyExtractor, collection Links, hash generator with default number of virtual nodes per collection(128)
Parameters:
HashPartitionResolver
public HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable
HashPartitionResolver constructor taking in the PartitionKeyExtractor, collection Links, number of virtual nodes per collection and default hash generator(MurmurHash3)
Parameters:
HashPartitionResolver
public HashPartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Iterable
HashPartitionResolver constructor taking in the PartitionKeyExtractor, collection Links, hash generator and number of virtual nodes per collection
Parameters:
Method Details
resolveForCreate
public String resolveForCreate(Object document)
Resolves the collection for creating the document based on the partition key.
Parameters:
Returns:
resolveForRead
public Iterable
Resolves the collection for reading/querying the documents based on the partition key.
Parameters:
Returns:
Applies to
Azure SDK for Java