/** * @nahisaho/yata-scale - L1 Cache (Hot) * * In-memory LRU cache for frequently accessed data */ import type { CacheStats, Entity, Relationship } from '../types.js'; /** * L1 Cache - Hot tier, in-memory LRU */ export declare class L1Cache { private readonly entityCache; private readonly relationshipCache; private hits; private misses; constructor(maxEntries?: 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; /** * Check if entity exists in cache */ hasEntity(id: string): boolean; /** * Check if relationship exists in cache */ hasRelationship(id: string): boolean; /** * Get multiple entities */ getEntities(ids: string[]): Map; /** * Set multiple entities */ setEntities(entities: Entity[]): void; /** * Clear all caches */ clear(): void; /** * Get hot keys (most accessed) */ getHotKeys(limit?: number): string[]; /** * Prewarm cache with entities */ prewarm(entities: Entity[]): void; /** * Get cache statistics */ getStats(): CacheStats; /** * Estimate memory size */ private estimateSize; /** * Estimate entity size in bytes */ private estimateEntitySize; /** * Estimate relationship size in bytes */ private estimateRelationshipSize; /** * Get entity count */ get entityCount(): number; /** * Get relationship count */ get relationshipCount(): number; /** * Get total entry count */ get size(): number; } //# sourceMappingURL=L1Cache.d.ts.map