Condividi tramite


HashPartitionResolver Constructors

Definition

Overloads

HashPartitionResolver(Func<Object,String>, IEnumerable<String>, Int32, IHashGenerator)

Initializes a new instance of the HashPartitionResolver in the Azure Cosmos DB service using the specified partitionKeyExtractor value.

HashPartitionResolver(String, IEnumerable<String>, Int32, IHashGenerator)

Initializes a new instance of the HashPartitionResolver in the Azure Cosmos DB service using the specified partitionKeyPropertyName value.

HashPartitionResolver(Func<Object,String>, IEnumerable<String>, Int32, IHashGenerator)

Initializes a new instance of the HashPartitionResolver in the Azure Cosmos DB service using the specified partitionKeyExtractor value.

public HashPartitionResolver (Func<object,string> partitionKeyExtractor, System.Collections.Generic.IEnumerable<string> collectionLinks, int numberOfVirtualNodesPerCollection = 128, Microsoft.Azure.Documents.Partitioning.IHashGenerator hashGenerator = default);
new Microsoft.Azure.Documents.Partitioning.HashPartitionResolver : Func<obj, string> * seq<string> * int * Microsoft.Azure.Documents.Partitioning.IHashGenerator -> Microsoft.Azure.Documents.Partitioning.HashPartitionResolver
Public Sub New (partitionKeyExtractor As Func(Of Object, String), collectionLinks As IEnumerable(Of String), Optional numberOfVirtualNodesPerCollection As Integer = 128, Optional hashGenerator As IHashGenerator = Nothing)

Parameters

partitionKeyExtractor
Func<Object,String>

A function to extract the partitionKey from the document

collectionLinks
IEnumerable<String>

The list of collection links used for hashing.

numberOfVirtualNodesPerCollection
Int32

The number of virtual nodes per collection in the conisistent hash ring.

hashGenerator
IHashGenerator

The IHashGenerator to use in consistent hashing. If null, the default MD5 hash generator is used.

Applies to

HashPartitionResolver(String, IEnumerable<String>, Int32, IHashGenerator)

Initializes a new instance of the HashPartitionResolver in the Azure Cosmos DB service using the specified partitionKeyPropertyName value.

public HashPartitionResolver (string partitionKeyPropertyName, System.Collections.Generic.IEnumerable<string> collectionLinks, int numberOfVirtualNodesPerCollection = 128, Microsoft.Azure.Documents.Partitioning.IHashGenerator hashGenerator = default);
new Microsoft.Azure.Documents.Partitioning.HashPartitionResolver : string * seq<string> * int * Microsoft.Azure.Documents.Partitioning.IHashGenerator -> Microsoft.Azure.Documents.Partitioning.HashPartitionResolver
Public Sub New (partitionKeyPropertyName As String, collectionLinks As IEnumerable(Of String), Optional numberOfVirtualNodesPerCollection As Integer = 128, Optional hashGenerator As IHashGenerator = Nothing)

Parameters

partitionKeyPropertyName
String

The name of the property in the document to execute the hashing on.

collectionLinks
IEnumerable<String>

The list of collection links used for hashing.

numberOfVirtualNodesPerCollection
Int32

The number of virtual nodes per collection in the conisistent hash ring.

hashGenerator
IHashGenerator

The IHashGenerator to use in consistent hashing. If null, the default MD5 hash generator is used.

Remarks

Use when you want to partition based on a single property name. For other partitioning schemes, use the constructor with partitionKeyExtractor instead.

Applies to