C# Class AngularAzureSearch.WebAPI.Initializers.PartitionInitializers

Partition Initializers contains a collection of methods to initialize different partition resolvers to use such things as hash partitioning, lookup partitioning, and range partitioning.
ファイルを表示 Open project: TheDarkCode/AngularAzureSearch

Public Properties

Property Type Description
defaultOfferType string

Public Methods

Method Description
InitializeCustomHashResolver ( string>.Func partitionKeyExtractor, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, string collectionNames ) : Task

Initialize a HashPartitionResolver that uses a custom function to extract the partition key.

InitializeHashResolver ( string partitionKeyPropertyName, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, string collectionNames ) : Task

Initialize a HashPartitionResolver.

InitializeLookupPartitionResolver ( string partitionKeyPropertyName, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, string collectionNames ) : Task>

Initialize a LookupPartitionResolver. Default is for US East/West to go to first collection name, Europe to second, and AsiaPacific / Other to third.

InitializeManagedHashResolver ( string>.Func partitionKeyExtractor, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, int numCollections, DocumentCollectionSpec collectionSpec ) : ManagedHashPartitionResolver

Initialize a "managed" HashPartitionResolver that also takes care of creating collections, and cloning collection properties like stored procedures, offer type and indexing policy.

InitializeRangeResolver ( string partitionKeyPropertyName, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, string collectionNames ) : Task>

Initialize a RangePartitionResolver.

Method Details

InitializeCustomHashResolver() public static method

Initialize a HashPartitionResolver that uses a custom function to extract the partition key.
public static InitializeCustomHashResolver ( string>.Func partitionKeyExtractor, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, string collectionNames ) : Task
partitionKeyExtractor string>.Func The partition key extractor function.
client Microsoft.Azure.Documents.Client.DocumentClient The DocumentDB client instance to use.
database Microsoft.Azure.Documents.Database The database to run the samples on.
collectionNames string The names of collections used.
return Task

InitializeHashResolver() public static method

Initialize a HashPartitionResolver.
public static InitializeHashResolver ( string partitionKeyPropertyName, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, string collectionNames ) : Task
partitionKeyPropertyName string The property name to be used as the partition Key.
client Microsoft.Azure.Documents.Client.DocumentClient The DocumentDB client instance to use.
database Microsoft.Azure.Documents.Database The database to run the samples on.
collectionNames string The names of collections used.
return Task

InitializeLookupPartitionResolver() public static method

Initialize a LookupPartitionResolver. Default is for US East/West to go to first collection name, Europe to second, and AsiaPacific / Other to third.
public static InitializeLookupPartitionResolver ( string partitionKeyPropertyName, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, string collectionNames ) : Task>
partitionKeyPropertyName string The property name to be used as the partition Key.
client Microsoft.Azure.Documents.Client.DocumentClient The DocumentDB client instance to use.
database Microsoft.Azure.Documents.Database The database to run the samples on.
collectionNames string The names of collections used.
return Task>

InitializeManagedHashResolver() public static method

Initialize a "managed" HashPartitionResolver that also takes care of creating collections, and cloning collection properties like stored procedures, offer type and indexing policy.
public static InitializeManagedHashResolver ( string>.Func partitionKeyExtractor, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, int numCollections, DocumentCollectionSpec collectionSpec ) : ManagedHashPartitionResolver
partitionKeyExtractor string>.Func The partition key extractor function. (Ex: "u => ((UserProfile)u).UserId")
client Microsoft.Azure.Documents.Client.DocumentClient The DocumentDB client instance to use.
database Microsoft.Azure.Documents.Database The database to run the samples on.
numCollections int The number of collections to be used.
collectionSpec AngularAzureSearch.WebAPI.Helpers.DocumentCollectionSpec The DocumentCollectionSpec to be used for each collection created. If null returns Spec with defaultOfferType as set in config.
return AngularAzureSearch.WebAPI.PartitionResolvers.ManagedHashPartitionResolver

InitializeRangeResolver() public static method

Initialize a RangePartitionResolver.
public static InitializeRangeResolver ( string partitionKeyPropertyName, Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, string collectionNames ) : Task>
partitionKeyPropertyName string The property name to be used as the partition Key.
client Microsoft.Azure.Documents.Client.DocumentClient The DocumentDB client instance to use.
database Microsoft.Azure.Documents.Database The database to run the samples on.
collectionNames string The names of collections used.
return Task>

Property Details

defaultOfferType public_oe static_oe property

The defaultOfferType is set in the config file, ie: S1, S2, S3. Will be used if no DocumentCollectionSpec is included for ManagedHashResolver.
public static string defaultOfferType
return string