/** * @nahisaho/yata-scale - Query Coordinator * * Coordinates query execution across shards */ import { type Result } from 'neverthrow'; import type { GraphQuery, QueryResult, QueryPlan, Entity, Relationship } from './types.js'; import { QueryError } from './errors.js'; /** * Query planner */ export declare class QueryPlanner { plan(query: GraphQuery, shards: string[]): QueryPlan; optimize(plan: QueryPlan): QueryPlan; private generateCacheKey; } /** * Worker pool for parallel execution */ export declare class WorkerPool { private concurrency; private active; private pending; constructor(concurrency: number); map(items: T[], fn: (item: T) => R | Promise): Promise; filter(items: T[], predicate: (item: T) => boolean | Promise): Promise; reduce(items: T[], fn: (acc: R, item: T) => R | Promise, initial: R): Promise; get activeCount(): number; get pendingCount(): number; shutdown(): Promise; } /** * Distributed query executor */ export declare class DistributedExecutor { private pool; private timeout; private stats; constructor(concurrency: number, timeout: number); execute(query: GraphQuery, shards: string[], executor: (shardId: string, query: GraphQuery) => Promise<{ entities: Entity[]; relationships: Relationship[]; }>): Promise>; private executeOnShards; private timeoutPromise; private mergeResults; getStats(): { totalQueries: number; averageLatency: number; }; shutdown(): Promise; } /** * Query coordinator */ export declare class QueryCoordinator { private planner; private executor; private cache; private cacheTtl; private stats; constructor(concurrency: number, cacheTtl: number, timeout: number); query(query: GraphQuery, shards: string[], executor: (shardId: string, query: GraphQuery) => Promise<{ entities: Entity[]; relationships: Relationship[]; }>): Promise>; validate(query: GraphQuery): Result; explain(query: GraphQuery, shards: string[]): string; getStats(): { cacheHits: number; cacheMisses: number; }; clearCache(): void; shutdown(): Promise; } //# sourceMappingURL=QueryCoordinator.d.ts.map