MCPcopy Create free account
hub / github.com/cosdata/cosdata / new

Method new

src/models/cache_loader.rs:53–77  ·  view source on GitHub ↗
(
        bufmans: BufferManagerFactory<IndexFileId>,
        latest_version_links_bufman: FilelessBufferManager,
        root_path: PathBuf,
        enable_context_history: bool,
        prop_file: R

Source from the content-addressed store, hash-verified

51
52impl HNSWIndexCache {
53 pub fn new(
54 bufmans: BufferManagerFactory<IndexFileId>,
55 latest_version_links_bufman: FilelessBufferManager,
56 root_path: PathBuf,
57 enable_context_history: bool,
58 prop_file: RwLock<File>,
59 distance_metric: Arc<RwLock<DistanceMetric>>,
60 ) -> Self {
61 let registry = LRUCache::with_prob_eviction(100_000_000, 0.03125);
62 let props_registry = DashMap::new();
63 let metadata_registry = DashMap::new();
64 Self {
65 registry,
66 props_registry,
67 bufmans,
68 latest_version_links_bufman,
69 root_path,
70 enable_context_history,
71 prop_file,
72 distance_metric,
73 loading_items: TSHashTable::new(16),
74 batch_load_lock: Mutex::new(()),
75 metadata_registry,
76 }
77 }
78
79 #[allow(clippy::not_unsafe_ptr_arg_deref)]
80 pub fn unload(&self, item: SharedNode) -> Result<(), BufIoError> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected