Interface ITenantShardMap
Resolves shard routing information for a given tenant.
public interface ITenantShardMap
- Extension Methods
Remarks
Implementations must be fast (target < 1us) since shard resolution is on every data operation's hot path. Dictionary lookup or hash-based routing is expected.
When the tenant is not found and no default shard is configured, implementations should throw TenantShardNotFoundException.
Methods
GetRegisteredShardIds()
Gets all registered shard IDs in this map.
IReadOnlyCollection<string> GetRegisteredShardIds()
Returns
- IReadOnlyCollection<string>
The collection of registered shard identifiers.
GetShardById(string)
Gets a registered physical shard without tenant routing or default fallback.
ShardInfo GetShardById(string shardId)
Parameters
shardIdstringThe registered physical shard identifier.
Returns
- ShardInfo
The exact shard's configured coordinates.
Exceptions
- KeyNotFoundException
The physical shard is not registered.
GetShardInfo(string)
Gets the shard information for the specified tenant.
ShardInfo GetShardInfo(string tenantId)
Parameters
tenantIdstringThe tenant identifier.
Returns
- ShardInfo
The shard routing information for the tenant.
Exceptions
- TenantShardNotFoundException
Thrown when the tenant is not mapped to any shard and no default shard is configured.