/** * @nahisaho/yata-scale - Range Partition Strategy * * Range-based partitioning for ordered data distribution */ import type { PartitionStrategy, PartitionStrategyType, EntityMetadata } from '../types.js'; /** * Range configuration for a shard */ export interface RangeConfig { readonly shardId: string; readonly start: string; readonly end: string; } /** * Range partition strategy for ordered key distribution */ export declare class RangePartitionStrategy implements PartitionStrategy { readonly type: PartitionStrategyType; private ranges; constructor(ranges: RangeConfig[]); /** * Validate ranges don't overlap and sort them */ private validateAndSortRanges; /** * Extract partition key from entity ID or metadata */ private extractPartitionKey; /** * Get shard ID for an entity using binary search */ getShardId(entityId: string, metadata?: Partial): string; /** * Get shard IDs for multiple entities */ getShardIds(entityIds: string[]): Map; /** * Calculate remapping when ranges change */ remap(oldShardCount: number, newShardCount: number): Map; /** * Split a range into two */ splitRange(shardId: string, splitPoint: string, newShardId: string): RangeConfig[]; /** * Merge two adjacent ranges */ mergeRanges(shardId1: string, shardId2: string, mergedShardId: string): RangeConfig; /** * Get all ranges */ getRanges(): readonly RangeConfig[]; /** * Get all shard IDs */ getShardIdsList(): string[]; /** * Get shard count */ get shardCount(): number; } //# sourceMappingURL=RangePartitionStrategy.d.ts.map