/** * @nahisaho/yata-scale - L2 Cache (Warm) * * Compressed in-memory cache for warm data */ import type { CacheStats, Entity, Relationship } from '../types.js'; /** * L2 Cache - Warm tier with compression */ export declare class L2Cache { private readonly entities; private readonly relationships; private readonly maxSize; private currentSize; private hits; private misses; private evictions; constructor(maxSizeBytes?: number); /** * Get entity from cache */ getEntity(id: string): Entity | undefined; /** * Set entity in cache */ setEntity(entity: Entity): void; /** * Delete entity from cache */ deleteEntity(id: string): boolean; /** * Get relationship from cache */ getRelationship(id: string): Relationship | undefined; /** * Set relationship in cache */ setRelationship(relationship: Relationship): void; /** * Delete relationship from cache */ deleteRelationship(id: string): boolean; /** * Compress data (simple JSON + text encoding) * In production, would use zstd, lz4, or similar */ private compress; /** * Decompress data */ private decompress; /** * Evict least recently used entry */ private evictOne; /** * Promote entity to L1 (returns it for L1 to cache) */ promoteEntity(id: string): Entity | undefined; /** * Demote entity from L1 (accepts and caches it) */ demoteEntity(entity: Entity): void; /** * Clear all caches */ clear(): void; /** * Get compression ratio */ getCompressionRatio(): number; /** * Get cache statistics */ getStats(): CacheStats; /** * Get entity count */ get entityCount(): number; /** * Get relationship count */ get relationshipCount(): number; /** * Get total entry count */ get size(): number; /** * Get current size in bytes */ get sizeBytes(): number; } //# sourceMappingURL=L2Cache.d.ts.map