C# Class AngularAzureSearch.WebAPI.PartitionResolvers.TransitionHashPartitionResolver

Creates a partition resolver that handles routing of reads and creates during transitions between partitioning configurations. Most commonly when you add an additional collection to the hash ring. This also shows how you can manage the policy for handling reads during migration (read both old and new partitions, or throw a retry-able error, etc.)
Inheritance: IPartitionResolver
Mostrar archivo Open project: TheDarkCode/AngularAzureSearch Class Usage Examples

Public Methods

Method Description
GetPartitionKey ( object document ) : object

Returns the partition key for the document.

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 partitionKey, based on the TransitionReadMode.

TransitionHashPartitionResolver ( IPartitionResolver current, IPartitionResolver next, TransitionReadMode readMode = TransitionReadMode.ReadBoth ) : System

Initializes a new instance of the TransitionHashPartitionResolver class.

Method Details

GetPartitionKey() public method

Returns the partition key for the document.
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 partitionKey, based on the TransitionReadMode.
public ResolveForRead ( object partitionKey ) : IEnumerable
partitionKey object The partition key for the read.
return IEnumerable

TransitionHashPartitionResolver() public method

Initializes a new instance of the TransitionHashPartitionResolver class.
public TransitionHashPartitionResolver ( IPartitionResolver current, IPartitionResolver next, TransitionReadMode readMode = TransitionReadMode.ReadBoth ) : System
current IPartitionResolver The current IPartitionResolver.
next IPartitionResolver The next IPartitionResolver.
readMode TransitionReadMode How to handle read requests during transition.
return System