Legacy thin compat shim over milvus-clj.client.
Historical shape: a flat API of 21 functions holding a defonce
singleton MilvusServiceClient. The protocol refactor (see
milvus-clj.client) split the implementation into transport-
specific records under milvus-clj.transport.*. This ns survives
as a delegating layer so existing callers (hive-milvus is the sole
consumer) need not migrate in one PR.
The singleton lives in *default-client*. connect! builds a
GrpcClient via client/make and stores it. Every op reads
@default-client, dispatches to the protocol method, and wraps
the return in future to preserve the legacy @(milvus/...)
call pattern hive-milvus depends on.
This ns will be deleted in PR-4 once all call sites migrate to
milvus-clj.client/with-client.
Backward compatibility notes:
connect! / disconnect! / connected? preserve the old
singleton lifecycle.@).connect! pass through to
milvus-clj.client/make under {:transport :grpc} defaults.resolve-consistency + with-connection macro preserved
(hive-milvus uses neither today, but external callers might).Legacy thin compat shim over `milvus-clj.client`.
Historical shape: a flat API of 21 functions holding a `defonce`
singleton MilvusServiceClient. The protocol refactor (see
`milvus-clj.client`) split the implementation into transport-
specific records under `milvus-clj.transport.*`. This ns survives
as a delegating layer so existing callers (hive-milvus is the sole
consumer) need not migrate in one PR.
The singleton lives in `*default-client*`. `connect!` builds a
`GrpcClient` via `client/make` and stores it. Every op reads
`@default-client`, dispatches to the protocol method, and wraps
the return in `future` to preserve the legacy `@(milvus/...)`
call pattern hive-milvus depends on.
This ns will be deleted in PR-4 once all call sites migrate to
`milvus-clj.client/with-client`.
Backward compatibility notes:
- `connect!` / `disconnect!` / `connected?` preserve the old
singleton lifecycle.
- Every op still returns a future (deref with `@`).
- Config keys merged via `connect!` pass through to
`milvus-clj.client/make` under `{:transport :grpc}` defaults.
- `resolve-consistency` + `with-connection` macro preserved
(hive-milvus uses neither today, but external callers might).(add collection-name records & {:keys [upsert? partition] :or {upsert? false}})Insert or upsert records. Returns future. Options: :upsert? (default false), :partition.
Insert or upsert records. Returns future. Options: :upsert? (default false), :partition.
(collection-stats collection-name)Basic collection stats. Returns future<map>.
Basic collection stats. Returns future<map>.
(connect!)(connect! opts)Connect to Milvus using the configured transport.
Preserved signatures: (connect!) (connect! {:host "milvus.prod" :port 19530}) (connect! {:transport :http :host "milvus.prod"})
Merges opts into milvus-clj.config (legacy flat shape), constructs
the appropriate transport-specific client via milvus-clj.client/make,
and stores it in the singleton default-client atom.
Returns the underlying transport-native client for backward compat:
MilvusServiceClient instance (legacy callers may hold it)HttpClient defrecord (no legacy raw reference exists)New code should use milvus-clj.client/with-client + protocol methods
directly instead of this singleton path.
Connect to Milvus using the configured transport.
Preserved signatures:
(connect!)
(connect! {:host "milvus.prod" :port 19530})
(connect! {:transport :http :host "milvus.prod"})
Merges opts into `milvus-clj.config` (legacy flat shape), constructs
the appropriate transport-specific client via `milvus-clj.client/make`,
and stores it in the singleton `default-client` atom.
Returns the underlying transport-native client for backward compat:
- gRPC: the `MilvusServiceClient` instance (legacy callers may hold it)
- HTTP: the `HttpClient` defrecord (no legacy raw reference exists)
New code should use `milvus-clj.client/with-client` + protocol methods
directly instead of this singleton path.(connected?)Real liveness check — verifies the singleton client can actually reach the server, not merely that the atom holds a reference.
Caches a positive result for ~5s so a burst of consumer calls amortises to one RPC. A negative result immediately invalidates the cache so the resilience layer's reconnect loop sees the truth on its next poll.
Returns false (does NOT throw) on IO/fatal — callers reasoning about
liveness want a boolean, not an exception. The reactive retry path
(with-auto-reconnect) catches throws on the actual RPC site.
Real liveness check — verifies the singleton client can actually reach the server, not merely that the atom holds a reference. Caches a positive result for ~5s so a burst of consumer calls amortises to one RPC. A negative result immediately invalidates the cache so the resilience layer's reconnect loop sees the truth on its next poll. Returns false (does NOT throw) on IO/fatal — callers reasoning about liveness want a boolean, not an exception. The reactive retry path (`with-auto-reconnect`) catches throws on the actual RPC site.
Map keyword → ConsistencyLevelEnum (gRPC-only concept).
Map keyword → ConsistencyLevelEnum (gRPC-only concept).
(create-collection collection-name opts)Create a Milvus collection with schema + optional index. Returns future.
See milvus-clj.client/-create-collection.
Create a Milvus collection with schema + optional index. Returns future. See `milvus-clj.client/-create-collection`.
(create-index collection-name index-opts)Create an index on a collection field. Returns future.
Create an index on a collection field. Returns future.
(delete collection-name ids & {:keys [partition]})Delete records by IDs. Returns future. Options: :partition.
Delete records by IDs. Returns future. Options: :partition.
(disconnect!)Close the active client and clear the singleton. Idempotent.
Close the active client and clear the singleton. Idempotent.
(drop-collection collection-name)Drop a collection. Returns future.
Drop a collection. Returns future.
(drop-index collection-name field-name)Drop an index from a collection field. Returns future.
Drop an index from a collection field. Returns future.
(flush-collection collection-name)Flush collection to storage. Returns future.
Flush collection to storage. Returns future.
(get collection-name
ids
&
{:keys [include consistency-level] :or {consistency-level :strong}})Get records by IDs. Returns future<vec>. Options: :include, :consistency-level.
Get records by IDs. Returns future<vec>. Options: :include, :consistency-level.
(get-collection collection-name)Describe a collection's schema. Returns future<map>.
Describe a collection's schema. Returns future<map>.
(has-collection collection-name)Check if a collection exists. Returns future<boolean>.
Check if a collection exists. Returns future<boolean>.
(invalidate-probe-cache!)Force the next connected? call to re-probe. Hook for the resilience
layer to call after a reactive failure so the cache stays honest.
Force the next `connected?` call to re-probe. Hook for the resilience layer to call after a reactive failure so the cache stays honest.
(list-collections)List all collection names. Returns future<vector<string>>.
List all collection names. Returns future<vector<string>>.
(load-collection collection-name)Load a collection into memory. Returns future.
Load a collection into memory. Returns future.
(query collection-name q-map)Vector similarity search. Returns future<vec>.
See milvus-clj.client/-query for q-map shape.
Vector similarity search. Returns future<vec>. See `milvus-clj.client/-query` for q-map shape.
(query-scalar collection-name q-map)Scalar filter query. Returns future<vec>.
Scalar filter query. Returns future<vec>.
(release-collection collection-name)Release a collection from memory. Returns future.
Release a collection from memory. Returns future.
(resolve-consistency kw)Resolve keyword to a gRPC ConsistencyLevelEnum. Nil means default.
Resolve keyword to a gRPC ConsistencyLevelEnum. Nil means default.
(with-connection opts & body)Execute body with a temporary Milvus connection that auto-disconnects.
Preserved for backward compat — new code should use
milvus-clj.client/with-client.
Execute body with a temporary Milvus connection that auto-disconnects. Preserved for backward compat — new code should use `milvus-clj.client/with-client`.
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 |