RangePartitionResolver<T> Class

  • java.lang.Object
    • com.microsoft.azure.documentdb.RangePartitionResolver<T>

Type Parameters

T

Implements


public class RangePartitionResolver
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
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

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

RangePartitionResolver

public RangePartitionResolver(PartitionKeyExtractor partitionKeyExtractor, Map<>,String> partitionMap)

RangePartitionResolver constructor taking in the PartitionKeyExtractor, a map of Ranges to collection links.

Parameters:

partitionKeyExtractor - an instance of class that implements PartitionKeyExtractor interface.
partitionMap - the map of ranges to collection links.

Method Details

resolveForCreate

public String resolveForCreate(Object document)

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

Parameters:

document - the document to be created.

Returns:

collection Self link or Name based link which should handle the Create operation.

resolveForRead

public Iterable resolveForRead(Object partitionKey)

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

Parameters:

partitionKey - the partition key value.

Returns:

collection Self link(s) or Name based link(s) which should handle the Read operation.

Applies to