RangePartitionResolver<T> Class
- java.
lang. Object - PartitionResolver
- com.
microsoft. azure. documentdb. RangePartitionResolver<T>
- com.
Type Parameters
- T
public class RangePartitionResolver<T extends Comparable> implements PartitionResolver
RangePartitionResolver implements partitioning based on the ranges in the Azure Cosmos DB database service. It allows you to distribute requests and data across a number of partitions by implementing PartitionResolver interface.
Constructor Summary
Constructor | Description |
---|---|
RangePartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Map<Range<T>, String> partitionMap) |
RangePartitionResolver constructor taking in the PartitionKeyExtractor, a map of Ranges to collection links. |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
resolveForCreate(Object document)
Resolves the collection for creating the document based on the partition key. |
Iterable<String> |
resolveForRead(Object partitionKey)
Resolves the collection for reading/querying the documents based on the partition key. |
Constructor Details
RangePartitionResolver
public RangePartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Map
RangePartitionResolver constructor taking in the PartitionKeyExtractor, a map of Ranges to collection links.
Parameters:
Method Details
resolveForCreate
public String resolveForCreate(Object document)
Resolves the collection for creating the document based on the partition key.
Overrides:
RangePartitionResolver<T>.resolveForCreate(Object document)Parameters:
Returns:
resolveForRead
public Iterable
Resolves the collection for reading/querying the documents based on the partition key.
Overrides:
RangePartitionResolver<T>.resolveForRead(Object partitionKey)Parameters:
Returns:
Applies to
Azure SDK for Java