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
Afficher le fichier Open project: TheDarkCode/AngularAzureSearch Class Usage Examples

Private Properties

Свойство Type Description
CreateCollectionIfRequired void
GetCollections List
ShouldCreateCollection bool

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

ResolveForCreate() public méthode

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

ResolveForRead() public méthode

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.
Résultat IEnumerable

SpilloverPartitionResolver() public méthode

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.
Résultat System