/** * Context Cache - Optimized caching layer for context operations */ import { EventEmitter } from 'events'; import { CacheService } from './cache.service'; import { ContextStore } from '../context/context-store'; import { ContextEntry, ContextQuery } from '@latestgraviton/protocol'; /** * Context cache statistics */ export interface ContextCacheStats { totalRequests: number; cacheHits: number; cacheMisses: number; hitRatio: number; avgLoadTime: number; prefetchedEntries: number; evictedEntries: number; memoryUsage: number; } /** * Context Cache Layer */ export declare class ContextCache extends EventEmitter { private cache; private store; private logger; private stats; private prefetchQueue; private prefetchInterval?; private bloomFilter; constructor(cache: CacheService, store: ContextStore); /** * Setup event handlers */ private setupEventHandlers; /** * Start prefetching */ private startPrefetching; /** * Stop prefetching */ private stopPrefetching; /** * Get context entry with caching */ get(key: string): Promise; /** * Query context with caching */ query(query: ContextQuery): Promise; /** * Bulk get with caching */ bulkGet(keys: string[]): Promise>; /** * Prefetch related context */ prefetch(keys: string[]): Promise; /** * Process prefetch queue */ private processPrefetchQueue; /** * Schedule prefetch for related context */ private schedulePrefetch; /** * Check if should prefetch */ private checkPrefetch; /** * Cache individual entries */ private cacheIndividualEntries; /** * Invalidate cache */ private invalidateCache; /** * Warm up cache with frequently accessed context */ warmUp(): Promise; /** * Clear cache */ clear(): Promise; /** * Create cache key */ private createCacheKey; /** * Hash query for caching */ private hashQuery; /** * Determine query TTL */ private determineQueryTTL; /** * Record cache hit */ private recordHit; /** * Update statistics */ private updateStats; /** * Update hit ratio */ private updateHitRatio; /** * Reset statistics */ private resetStats; /** * Get statistics */ getStatistics(): ContextCacheStats; /** * Destroy cache */ destroy(): void; } //# sourceMappingURL=context-cache.d.ts.map