/** * @nahisaho/yata-scale - Query Coordinator * * High-level query coordination and caching */ import { type Result } from 'neverthrow'; import type { GraphQuery, QueryResult, QueryOptions, Entity } from '../types.js'; import { QueryError } from '../errors.js'; import { QueryPlanner } from './QueryPlanner.js'; import { DistributedExecutor, type ShardQueryFn } from './DistributedExecutor.js'; /** * Query coordinator for managing query lifecycle */ export declare class QueryCoordinator { private readonly planner; private readonly executor; private readonly cache; private readonly maxCacheSize; private readonly defaultCacheTtlMs; constructor(parallelism?: number, maxCacheSize?: number, defaultCacheTtlMs?: number); /** * Execute a query */ query(graphQuery: GraphQuery, shards: string[], queryFn: ShardQueryFn, options?: QueryOptions): Promise>; /** * Validate query */ private validateQuery; /** * Get cache key for query */ private getCacheKey; /** * Get from cache */ private getFromCache; /** * Add to cache */ private addToCache; /** * Evict oldest cache entry */ private evictOldest; /** * Invalidate cache entries */ invalidateCache(pattern?: string): void; /** * Find entities by type */ findByType(entityType: string, shards: string[], queryFn: ShardQueryFn, options?: { limit?: number; offset?: number; }): Promise>; /** * Find entity by ID */ findById(entityId: string, shards: string[], queryFn: ShardQueryFn): Promise>; /** * Find related entities */ findRelated(entityId: string, relationshipType: string, shards: string[], queryFn: ShardQueryFn, options?: { depth?: number; limit?: number; }): Promise>; /** * Search entities */ search(searchQuery: string, shards: string[], queryFn: ShardQueryFn, options?: { entityTypes?: string[]; limit?: number; }): Promise>; /** * Explain query plan */ explain(query: GraphQuery): string; /** * Get query planner */ getPlanner(): QueryPlanner; /** * Get distributed executor */ getExecutor(): DistributedExecutor; /** * Get cache statistics */ getCacheStats(): { size: number; maxSize: number; }; /** * Shutdown coordinator */ shutdown(): Promise; } //# sourceMappingURL=QueryCoordinator.d.ts.map