(
bufmans: BufferManagerFactory<IndexFileId>,
latest_version_links_bufman: FilelessBufferManager,
root_path: PathBuf,
enable_context_history: bool,
prop_file: R
| 51 | |
| 52 | impl 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> { |
nothing calls this directly
no outgoing calls
no test coverage detected