C# Class AngularAzureSearch.WebAPI.PartitionResolvers.SpilloverPartitionResolver

Creates a PartitionResolver that automatically creates collections as they fill up. Default fillFactor is 90%. Prefix: "Collection."
Inheritance: IPartitionResolver
Datei anzeigen Open project: TheDarkCode/AngularAzureSearch Class Usage Examples

Private Properties

Property Type Description
CreateCollectionIfRequired void
GetCollections List
ShouldCreateCollection bool

Public Methods

Method Description
GetPartitionKey ( object document ) : object

Returns the partition key for the document. Bypass by returning null.

ResolveForCreate ( object partitionKey ) : string

Returns the collection to create this document. Returns the last collection.

ResolveForRead ( object partitionKey ) : IEnumerable

Returns the collections to read for a document. Here we return all collections.

SpilloverPartitionResolver ( Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, DocumentCollectionSpec collectionSpec = null, string collectionIdPrefix = "Collection.", double fillFactor = 0.90, double checkIntervalSeconds = 3600 ) : System

Initializes a new instance of the SpilloverPartitionResolver class.

Private Methods

Method Description
CreateCollectionIfRequired ( ) : void
GetCollections ( Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, string collectionIdPrefix, DocumentCollectionSpec spec ) : List

Gets or creates the collections for the hash resolver.

ShouldCreateCollection ( ) : bool

Check if a spillover has to be scheduled.

Method Details

GetPartitionKey() public method

Returns the partition key for the document. Bypass by returning null.
public GetPartitionKey ( object document ) : object
document object The document to locate.
return object

ResolveForCreate() public method

Returns the collection to create this document. Returns the last collection.
public ResolveForCreate ( object partitionKey ) : string
partitionKey object The partition key for the create.
return string

ResolveForRead() public method

Returns the collections to read for a document. Here we return all collections.
public ResolveForRead ( object partitionKey ) : IEnumerable
partitionKey object The partition key for the read.
return IEnumerable

SpilloverPartitionResolver() public method

Initializes a new instance of the SpilloverPartitionResolver class.
public SpilloverPartitionResolver ( Microsoft.Azure.Documents.Client.DocumentClient client, Microsoft.Azure.Documents.Database database, DocumentCollectionSpec collectionSpec = null, string collectionIdPrefix = "Collection.", double fillFactor = 0.90, double checkIntervalSeconds = 3600 ) : System
client Microsoft.Azure.Documents.Client.DocumentClient The DocumentDB client instance.
database Microsoft.Azure.Documents.Database The database to use.
collectionSpec AngularAzureSearch.WebAPI.Helpers.DocumentCollectionSpec The specification/template to create collections from.
collectionIdPrefix string The prefix to use for collections.
fillFactor double The fill factor for spilling over collections.
checkIntervalSeconds double The interval between collection size checks.
return System