TWeightedHashShardAllocator Class
IShardAllocator that allocates deterministically by hashing the tenant id over the active shards, weighted by their TShardInfo.Weight.
Remarks
The tenant id is hashed (FNV-1a) over the list of active shards expanded by their weight, so a shard with weight 2 receives roughly twice as many tenants as a shard with weight 1, and the same tenant id always maps to the same shard for a given shard configuration. This is the default allocator of TTenantProvisioner.
Syntax
Unit: Aurelius.Tenancy.Provisioning
TWeightedHashShardAllocator = class(TInterfacedObject, IShardAllocator);
Methods
| Name | Description |
|---|---|
| AllocateShard | Returns the active shard selected by the weighted hash of the tenant id. |