UNPKG

@simonecoelhosfo/optimizely-mcp-server

Version:

Optimizely MCP Server for AI assistants with integrated CLI tools

110 lines 2.62 kB
/** * Hybrid Executor - Multi-Phase Query Execution Engine * * The Hybrid Executor executes query plans using the optimal combination * of SQL, JSONata, and post-processing phases. It handles data flow * between phases and manages parallel execution when possible. */ import { FieldCatalog } from './FieldCatalog.js'; import type { ExecutionPlan, QueryResult, DataModelAdapter } from './types.js'; /** * Configuration for Hybrid Executor */ export interface HybridExecutorConfig { maxExecutionTime?: number; enableParallel?: boolean; cacheResults?: boolean; maxMemoryUsage?: number; } /** * Hybrid Executor implementation */ export declare class HybridExecutor { private adapters; private fieldCatalog; private config; private resultCache; private sqlBuilder; constructor(adapters: Map<string, DataModelAdapter>, fieldCatalog: FieldCatalog, config?: HybridExecutorConfig); /** * Execute a query plan */ execute(plan: ExecutionPlan): Promise<QueryResult>; /** * Execute phases sequentially */ private executeSequential; /** * Execute phases in parallel where possible */ private executeParallel; /** * Execute a single phase */ private executePhase; /** * Execute SQL phase */ private executeSQLPhase; /** * Execute JSONata phase */ private executeJSONataPhase; /** * Execute post-processing phase */ private executePostProcessPhase; /** * Build SQL query from phase query object */ private buildSQLQuery; /** * Apply GROUP BY to data */ private applyGroupBy; /** * Apply HAVING conditions */ private applyHaving; /** * Apply ORDER BY to data */ private applyOrderBy; /** * Evaluate a condition against a row */ private evaluateCondition; /** * Create final result object */ private createResult; /** * Group phases by dependencies for parallel execution */ private groupPhasesByDependencies; /** * Check if plan should be executed in parallel */ private shouldExecuteParallel; /** * Get adapter for entity */ private getAdapterForEntity; /** * Estimate memory usage of result */ private estimateMemoryUsage; /** * Get cached result */ private getCachedResult; /** * Cache result */ private cacheResult; /** * Generate cache key for plan */ private getCacheKey; } //# sourceMappingURL=HybridExecutor.d.ts.map