Collection loading and scalar-index management for MilvusMemoryStore.
Owns two process-wide memoization atoms:
loaded-collections: collections this process has load-collection'd.indexed-collections: collections we've probed + installed INVERTED
scalar indexes on.Both are defonce so hot-reload doesn't desync with milvus-clj's own
singleton client state.
Collection loading and scalar-index management for MilvusMemoryStore. Owns two process-wide memoization atoms: - `loaded-collections`: collections this process has `load-collection`'d. - `indexed-collections`: collections we've probed + installed INVERTED scalar indexes on. Both are `defonce` so hot-reload doesn't desync with milvus-clj's own singleton client state.
(ensure-collection! collection-name dimension)Ensure the memory collection exists and is loaded into memory.
After Milvus restart, collections exist but aren't loaded — queries
return empty unless we explicitly load. The per-process memo
(loaded-collections) is consulted FIRST: a memo hit issues no RPC at
all, so a write path calling this per entry costs nothing after the
first call. Only a miss probes has-collection, then creates or loads.
invalidate-loaded-collection! drops the memo when reconnect detects
a fresh server or a dropped collection.
Ensure the memory collection exists and is loaded into memory. After Milvus restart, collections exist but aren't loaded — queries return empty unless we explicitly load. The per-process memo (`loaded-collections`) is consulted FIRST: a memo hit issues no RPC at all, so a write path calling this per entry costs nothing after the first call. Only a miss probes has-collection, then creates or loads. `invalidate-loaded-collection!` drops the memo when reconnect detects a fresh server or a dropped collection.
(ensure-indexed! memo collection-name install!)Serialize installation per memo. A false result means build pending. Partial passes, pending builds and failures are never memoized.
Serialize installation per memo. A false result means build pending. Partial passes, pending builds and failures are never memoized.
(ensure-scalar-indexes! collection-name)Ensure type/project_id indexes. HTTP probes actual field definitions. HTTP memo is populated only after both builds report Finished.
Ensure type/project_id indexes. HTTP probes actual field definitions. HTTP memo is populated only after both builds report Finished.
Memoization guard so we only probe/install scalar indexes once per process per collection. defonce so hot-reload doesn't reset the guard while loaded-collections (also defonce) still holds the collection — that desync caused ensure-scalar-indexes! to be skipped on reconnect.
Memoization guard so we only probe/install scalar indexes once per process per collection. defonce so hot-reload doesn't reset the guard while loaded-collections (also defonce) still holds the collection — that desync caused ensure-scalar-indexes! to be skipped on reconnect.
Equality/IN fields used by catchup. Tags are serialized VarChar with infix LIKE filters; these indexes do not accelerate that predicate.
Equality/IN fields used by catchup. Tags are serialized VarChar with infix LIKE filters; these indexes do not accelerate that predicate.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |