HashPartitionResolver Class

 

Updated: June 30, 2017

Note: This API is now obsolete.

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

Namespace:   Microsoft.Azure.Documents.Partitioning
Assembly:  Microsoft.Azure.Documents.Client (in Microsoft.Azure.Documents.Client.dll)

SystemObject
  Microsoft.Azure.Documents.PartitioningHashPartitionResolver

No code example is currently available or this language may not be supported.

NameDescription
System_CAPS_pubmethodHashPartitionResolver

Initializes a new instance of the HashPartitionResolver in the Azure DocumentDB database service using the specified partitionKeyExtractor value.

System_CAPS_pubmethodHashPartitionResolver

Initializes a new instance of the HashPartitionResolver in the Azure DocumentDB database service using the specified partitionKeyPropertyName value.

NameDescription
System_CAPS_pubproperty

Gets the IEnumerable of collection links used for hashing in the Azure DocumentDB database service.

System_CAPS_pubproperty

Gets the HashGenerator used in consistent hashing.

System_CAPS_pubproperty

The number of virtual nodes per collection in the conisistent hash ring in the Azure DocumentDB database service. This controls the compromise of skewness of documents accross collections vs the consistent hashing latency.

System_CAPS_pubproperty

Gets the function to extract the partition key from an object in the Azure DocumentDB database service.

System_CAPS_pubproperty

Gets the name of the property in the document to execute the hashing on in the Azure DocumentDB database service.

NameDescription
System_CAPS_pubmethodDispose

Disposes the resolver in the Azure DocumentDB database service.

System_CAPS_pubmethodEquals

(Inherited from Object.)

System_CAPS_protmethodFinalize

Class destructor. (Overrides ObjectFinalize.)

System_CAPS_pubmethodGetHashCode

(Inherited from Object.)

System_CAPS_pubmethodGetPartitionKey

Extracts the partition key from the specified document using the specified property or function in order of preference in the Azure DocumentDB database service.

System_CAPS_pubmethodGetType

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone

(Inherited from Object.)

System_CAPS_pubmethodResolveForCreate

Given a partition key, returns the collection self-link for creating a document in the Azure DocumentDB database service.

System_CAPS_pubmethodResolveForRead

Given a partition key, returns a list of collection links to read from using its hash in the Azure DocumentDB database service.

System_CAPS_pubmethodToString

(Inherited from Object.)

NameDescription
System_CAPS_pubmethodIsDefined

Determines if a certain property is defined or not. (Defined by TypeCheckFunctionsExtensions.)

System_CAPS_pubmethodIsNull

Determines if a certain property is null or not. (Defined by TypeCheckFunctionsExtensions.)

System_CAPS_pubmethodIsPrimitive

Determines if a certain property is of premitive JSON type. (Defined by TypeCheckFunctionsExtensions.)

Support for IPartitionResolver based classes is now obsolete. It's recommended that you use Partitioned Collections for higher storage and throughput.

The HashPartitionResolver class internally implements a consistent hash ring over the hash function specified in the IHashGenerator interface. By default, the HashPartitionResolver provides an MD5 hash function, but this can be swapped out with a different hashing implementation. The consistent hash ring creates 16 replicas for each collection in order to achieve a more uniform distribution of documents across collections.

The hash partitioning is most suitable for partitioning when the partition key has a high cardinality because it will distribute the data evenly across collections. Typically hash partitioning uses the id property. A common use cases for hash partitioning is data produced or consumed from a large number of distinct clients or for storing user profiles, catalog items, and telemetry data.

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: