/** * SSD Tier Storage Implementation * Uses RocksDB (via classic-level) for warm data storage * Requirements: 2.2, 2.4 */ import { KeyMetadata } from '../types/index.js'; import { StorageTier, TierConfig } from './StorageTier.js'; /** * Value format for SSD storage: * [4 bytes: expires_at timestamp | 4 bytes: created_at | remaining: value bytes] * * expires_at: Unix timestamp in seconds (0 means no expiration) * created_at: Unix timestamp in seconds */ /** * SSDTier implements the StorageTier interface using RocksDB via classic-level. * This is the intermediate tier for warm data that is moderately accessed. */ export declare class SSDTier implements StorageTier { private db; private usedBytes; private capacityBytes; private isOpen; private storagePath; /** * Calculate the size in bytes of a key-value entry */ private calculateEntrySize; /** * Encode value with metadata into storage format * Format: [4 bytes: expires_at | 4 bytes: created_at | remaining: value] */ private encodeValue; /** * Decode stored value into value and metadata */ private decodeValue; /** * Check if a decoded entry is expired */ private isExpired; /** * Retrieve a value by key */ get(key: string): Promise; /** * Store a key-value pair with metadata */ set(key: string, value: Buffer, metadata: KeyMetadata): Promise; /** * Delete a key from the tier */ delete(key: string): Promise; /** * Check if a key exists in this tier */ exists(key: string): Promise; /** * Retrieve multiple values by keys (bulk operation) */ mget(keys: string[]): Promise>; /** * Store multiple key-value pairs (bulk operation) * Uses RocksDB batch writes for efficiency */ mset(entries: Map, metadata: KeyMetadata): Promise; /** * Get the current used bytes in this tier */ getUsedBytes(): number; /** * Get the maximum capacity in bytes for this tier */ getCapacityBytes(): number; /** * Iterate over keys in this tier, optionally filtered by pattern * Pattern supports simple glob matching with * wildcard */ keys(pattern?: string): AsyncIterableIterator; /** * Simple glob pattern matching with * wildcard */ private matchPattern; /** * Initialize and open the storage tier */ open(config: TierConfig): Promise; /** * Close the storage tier and release resources */ close(): Promise; /** * Flush any pending writes to persistent storage */ flush(): Promise; } //# sourceMappingURL=SSDTier.d.ts.map