antarys
Version:
High-performance Node.js client for Antarys vector database with HTTP/2, connection pooling, and intelligent caching
46 lines • 1.39 kB
TypeScript
import { SearchResults, CacheStats } from '../shared/types';
export declare class HighPerformanceCache<T> {
private cache;
private head?;
private tail?;
private readonly maxSize;
private readonly ttl;
private hits;
private misses;
private cleanupInterval?;
constructor(maxSize?: number, ttl?: number);
get(key: string): T | undefined;
set(key: string, value: T): void;
delete(key: string): boolean;
clear(): void;
getStats(): CacheStats;
private moveToFront;
private addToFront;
private removeNode;
private evictLRU;
private cleanup;
destroy(): void;
}
export declare class QueryCache {
private cache;
constructor(maxSize?: number, ttl?: number);
computeCacheKey(collection: string, vector: number[], topK: number, params?: Record<string, any>): string;
private hashVector;
get(key: string): SearchResults | undefined;
set(key: string, value: SearchResults): void;
clear(): void;
getStats(): CacheStats;
destroy(): void;
}
export declare class BufferPool {
private pools;
private readonly maxPoolSize;
private readonly sizes;
constructor(maxPoolSize?: number);
acquire(size: number): Buffer;
release(buffer: Buffer): void;
private getOriginalSize;
clear(): void;
getStats(): Record<string, number>;
}
//# sourceMappingURL=caching.d.ts.map