Permalink
Fetching contributors…
Cannot retrieve contributors at this time
278 lines (278 sloc) 17.4 KB
<Type Name="RangePartitionResolver&lt;T&gt;" FullName="Microsoft.Azure.Documents.Partitioning.RangePartitionResolver&lt;T&gt;">
<TypeSignature Language="C#" Value="public class RangePartitionResolver&lt;T&gt; : Microsoft.Azure.Documents.Client.IPartitionResolver where T : IComparable&lt;T&gt;, IEquatable&lt;T&gt;" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit RangePartitionResolver`1&lt;(class System.IComparable`1&lt;!T&gt;, class System.IEquatable`1&lt;!T&gt;) T&gt; extends System.Object implements class Microsoft.Azure.Documents.Client.IPartitionResolver" />
<TypeSignature Language="DocId" Value="T:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1" />
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
<TypeParameter Name="T">
<Constraints>
<InterfaceName>System.IComparable&lt;T&gt;</InterfaceName>
<InterfaceName>System.IEquatable&lt;T&gt;</InterfaceName>
</Constraints>
</TypeParameter>
</TypeParameters>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>Microsoft.Azure.Documents.Client.IPartitionResolver</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.Obsolete("Support for IPartitionResolver based classes is now obsolete. It's recommended that you use partitioned collections for higher storage and throughput.")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<typeparam name="T">The type of value to use for range partitioning.</typeparam>
<summary>
RangePartitionResolver implements partitioning in Azure DocumentDB database service by using a partition map of ranges of values to a collection self-link.
This works well when the data is naturally ordered and commonly queried upon using ranges of values, e.g., for
time series data or alphabetical ranges of strings.
</summary>
<remarks>
<para>
Support for IPartitionResolver based classes is now obsolete. It's recommended that you use
<a href="https://azure.microsoft.com/documentation/articles/documentdb-partition-data">Partitioned Collections</a> for higher storage and throughput.
</para>
<para>
In range partitioning, partitions are assigned based on whether the partition key is within a certain range. The
RangePartitionResolver class helps you maintain a mapping between a <see cref="T:Microsoft.Azure.Documents.Partitioning.Range`1" /> and collection self-link.
</para>
<para>
<see cref="T:Microsoft.Azure.Documents.Partitioning.Range`1" /> is a simple class for specifying ranges of any types that implement <see cref="T:System.IComparable`1" /> and <see cref="T:System.IEquatable`1" />
like strings or numbers. For reads and creates, you can pass in any arbitrary range, and the resolver identifies all the candidate collections by
identifying the ranges of the partitions that intersect twith the requested range.
</para>
<para>
A special case of range partitioning is when the range is just a single discrete value, sometimes called Lookup Partitioning. This is commonly used
for partitioning by discrete values like Region or Type or for partitioning tenants in a multi-tenant application.
</para>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public RangePartitionResolver (Func&lt;object,object&gt; partitionKeyExtractor, System.Collections.Generic.IDictionary&lt;Microsoft.Azure.Documents.Partitioning.Range&lt;T&gt;,string&gt; partitionMap);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Func`2&lt;object, object&gt; partitionKeyExtractor, class System.Collections.Generic.IDictionary`2&lt;class Microsoft.Azure.Documents.Partitioning.Range`1&lt;!T&gt;, string&gt; partitionMap) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1.#ctor(System.Func{System.Object,System.Object},System.Collections.Generic.IDictionary{Microsoft.Azure.Documents.Partitioning.Range{`0},System.String})" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="partitionKeyExtractor" Type="System.Func&lt;System.Object,System.Object&gt;" />
<Parameter Name="partitionMap" Type="System.Collections.Generic.IDictionary&lt;Microsoft.Azure.Documents.Partitioning.Range&lt;T&gt;,System.String&gt;" />
</Parameters>
<Docs>
<param name="partitionKeyExtractor">The name of the property in the document to execute the hashing on.</param>
<param name="partitionMap">A map from range to collection-link that is used for partitioning requests.</param>
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Azure.Documents.Partitioning.HashPartitionResolver" /> in the Azure DocumentDB database service using the specified <paramref name="partitionKeyExtractor" /> value.
</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">Thrown if one of the parameters is null.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public RangePartitionResolver (string partitionKeyPropertyName, System.Collections.Generic.IDictionary&lt;Microsoft.Azure.Documents.Partitioning.Range&lt;T&gt;,string&gt; partitionMap);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string partitionKeyPropertyName, class System.Collections.Generic.IDictionary`2&lt;class Microsoft.Azure.Documents.Partitioning.Range`1&lt;!T&gt;, string&gt; partitionMap) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1.#ctor(System.String,System.Collections.Generic.IDictionary{Microsoft.Azure.Documents.Partitioning.Range{`0},System.String})" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="partitionKeyPropertyName" Type="System.String" />
<Parameter Name="partitionMap" Type="System.Collections.Generic.IDictionary&lt;Microsoft.Azure.Documents.Partitioning.Range&lt;T&gt;,System.String&gt;" />
</Parameters>
<Docs>
<param name="partitionKeyPropertyName">The name of the property in the document to execute the hashing on.</param>
<param name="partitionMap">A map from range to collection-link that is used for partitioning requests.</param>
<summary>
Initializes a new instance of the <see cref="T:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1" /> class in the Azure DocumentDB database service using the specified <paramref name="partitionKeyPropertyName" /> value.
</summary>
<remarks>
Use when you want to partition based on a single property name. For other partitioning schemes, use the constructor
with partitionKeyExtractor instead.
</remarks>
<exception cref="T:System.ArgumentNullException">Thrown if one of the parameters is null.</exception>
</Docs>
</Member>
<Member MemberName="GetPartitionKey">
<MemberSignature Language="C#" Value="public virtual object GetPartitionKey (object document);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance object GetPartitionKey(object document) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1.GetPartitionKey(System.Object)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="document" Type="System.Object" />
</Parameters>
<Docs>
<param name="document">A document object</param>
<summary>
Extracts the partition key from the specified document using the specified <see cref="P:Microsoft.Azure.Documents.Partitioning.HashPartitionResolver.PartitionKeyPropertyName" />
property or <see cref="P:Microsoft.Azure.Documents.Partitioning.HashPartitionResolver.PartitionKeyExtractor" /> function in order of preference in the Azure DocumentDB database service.
</summary>
<returns>object used as the partition key.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.InvalidOperationException">Thrown if unable to extract the partition key.</exception>
</Docs>
</Member>
<Member MemberName="PartitionKeyExtractor">
<MemberSignature Language="C#" Value="public Func&lt;object,object&gt; PartitionKeyExtractor { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Func`2&lt;object, object&gt; PartitionKeyExtractor" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1.PartitionKeyExtractor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Func&lt;System.Object,System.Object&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets the function to extract the partition key from any object in the Azure DocumentDB database service.
</summary>
<value>
The function to extract the partition key from any object.
</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="PartitionKeyPropertyName">
<MemberSignature Language="C#" Value="public string PartitionKeyPropertyName { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string PartitionKeyPropertyName" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1.PartitionKeyPropertyName" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>
The name of the property in the document to execute the hashing on in the Azure DocumentDB database service.
</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="PartitionMap">
<MemberSignature Language="C#" Value="public System.Collections.Generic.IDictionary&lt;Microsoft.Azure.Documents.Partitioning.Range&lt;T&gt;,string&gt; PartitionMap { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IDictionary`2&lt;class Microsoft.Azure.Documents.Partitioning.Range`1&lt;!T&gt;, string&gt; PartitionMap" />
<MemberSignature Language="DocId" Value="P:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1.PartitionMap" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Generic.IDictionary&lt;Microsoft.Azure.Documents.Partitioning.Range&lt;T&gt;,System.String&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>
Gets the map from range to collection-link that is used for partitioning requests in the Azure DocumentDB database service.
</summary>
<value>
The map from range to collection-link that is used for partitioning requests.
</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ResolveForCreate">
<MemberSignature Language="C#" Value="public virtual string ResolveForCreate (object partitionKey);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string ResolveForCreate(object partitionKey) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1.ResolveForCreate(System.Object)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="partitionKey" Type="System.Object" />
</Parameters>
<Docs>
<param name="partitionKey">The partition key used to determine the target collection for create</param>
<summary>
Given a partition key, returns the correct collection self-link for creating a document using the range partition map in the Azure DocumentDB database service.
</summary>
<returns>The target collection link that will be used for document creation.</returns>
<remarks>
If multiple ranges match the specified partitionKey, then the resolver returns one of the matching ranges. If none of the
ranges match, then the method throws a <see cref="T:System.InvalidOperationException" />. If partitionKey is null, then all collections
are returned.
</remarks>
<exception cref="T:System.ArgumentNullException">Thrown if <paramref name="partitionKey" /> is null.</exception>
<exception cref="T:System.InvalidOperationException">
Thrown if the <paramref name="partitionKey" /> is an invalid type or if none of the ranges match the specified partition key.
</exception>
</Docs>
</Member>
<Member MemberName="ResolveForRead">
<MemberSignature Language="C#" Value="public virtual System.Collections.Generic.IEnumerable&lt;string&gt; ResolveForRead (object partitionKey);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Collections.Generic.IEnumerable`1&lt;string&gt; ResolveForRead(object partitionKey) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Azure.Documents.Partitioning.RangePartitionResolver`1.ResolveForRead(System.Object)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Azure.Documents.Client</AssemblyName>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<AssemblyVersion>1.16.0.0</AssemblyVersion>
<AssemblyVersion>1.17.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Generic.IEnumerable&lt;System.String&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="partitionKey" Type="System.Object" />
</Parameters>
<Docs>
<param name="partitionKey">The partition key used to determine the target collections for query</param>
<summary>
Given a partition key, returns a list of collection links to read from using the range partition map in the Azure DocumentDB database service.
</summary>
<returns>The list of target collection links.</returns>
<remarks>
The <paramref name="partitionKey" /> must be an instance of <typeparamref name="T" />, <see cref="T:Microsoft.Azure.Documents.Partitioning.Range`1" /> or an <see cref="T:System.Collections.Generic.IEnumerable`1" />."/&gt;.
This method returns all the collections corresponding to the ranges that intersect with the specified <paramref name="partitionKey" />.
</remarks>
<exception cref="T:System.InvalidOperationException">
Thrown if the <paramref name="partitionKey" /> is an invalid type.
</exception>
</Docs>
</Member>
</Members>
</Type>