Liking cljdoc? Tell your friends :D

hive-milvus.relocate

Background re-embedding + relocation of memory entries from non-canonical Milvus collections (e.g. legacy 768-d hive_mcp_memory) into per-dim collections (hive_mcp_memory_1024d, hive_mcp_memory_4096d) driven by current type-routing config.

Idempotent + resumable. entries/relocate-entry! is itself a no-op once an entry is already in its canonical collection, so resume never duplicates.

Background re-embedding + relocation of memory entries from
non-canonical Milvus collections (e.g. legacy 768-d
`hive_mcp_memory`) into per-dim collections (`hive_mcp_memory_1024d`,
`hive_mcp_memory_4096d`) driven by current type-routing config.

Idempotent + resumable. `entries/relocate-entry!` is itself a no-op
once an entry is already in its canonical collection, so resume
never duplicates.
raw docstring

reset-cursor!clj

(reset-cursor!)
(reset-cursor! source-coll)
(reset-cursor! source-coll cursor-base)

Delete the on-disk cursor for a source collection.

Delete the on-disk cursor for a source collection.
sourceraw docstring

start!clj

(start! config-atom)
(start! config-atom
        {:keys [mode source-coll batch-size cursor-base concurrency id-source
                relocate-fn max-excluded batch-writes?]
         :or {mode :move
              source-coll default-source-collection
              batch-size default-batch-size
              cursor-base default-cursor-base
              concurrency 1
              max-excluded plan/default-max-excluded
              batch-writes? true}})

Spawn a background relocation pass. Returns immediately with the new job's metadata, or {:already-running? true} when a previous job is still :running.

:mode :move (default) removes each row from the source once it has landed in the target, and iterates by re-reading the head of the source.

:mode :copy leaves every source row where it is. The old collection stays a complete backup. Because nothing is removed, the head would never empty, so the pass enumerates the source's ids up front and works through that snapshot.

Counters are per-run. Rows the pass cannot place (already-canonical no-ops, hard failures) are excluded from subsequent pages so the run terminates; they are reported, never silently counted as placed.

Writes are batched: each page is prepared concurrently, then written with ONE upsert per target collection (pipeline/commit-page). A failed batch falls back to per-record writes so every failed id is still named.

Opts: :mode :source-coll :batch-size :cursor-base :concurrency :max-excluded :id-source (IIdSource, overrides the mode's default source) :relocate-fn (id -> result, overrides the mode's default operation) :batch-writes? (default true; false writes one record per round-trip)

Spawn a background relocation pass. Returns immediately with the new
job's metadata, or {:already-running? true} when a previous job is
still :running.

:mode :move (default) removes each row from the source once it has landed in
the target, and iterates by re-reading the head of the source.

:mode :copy leaves every source row where it is. The old collection stays a
complete backup. Because nothing is removed, the head would never empty, so
the pass enumerates the source's ids up front and works through that snapshot.

Counters are per-run. Rows the pass cannot place (already-canonical no-ops,
hard failures) are excluded from subsequent pages so the run terminates; they
are reported, never silently counted as placed.

Writes are batched: each page is prepared concurrently, then written with
ONE upsert per target collection (`pipeline/commit-page`). A failed batch
falls back to per-record writes so every failed id is still named.

Opts: :mode :source-coll :batch-size :cursor-base :concurrency :max-excluded
      :id-source   (IIdSource, overrides the mode's default source)
      :relocate-fn (id -> result, overrides the mode's default operation)
      :batch-writes? (default true; false writes one record per round-trip)
sourceraw docstring

statusclj

(status)

Return current relocation state snapshot + on-disk cursor.

Return current relocation state snapshot + on-disk cursor.
sourceraw docstring

stop!clj

(stop!)

Request the running relocation to stop after the current batch.

Request the running relocation to stop after the current batch.
sourceraw docstring

unwrap-placedclj

(unwrap-placed id res)

Pure: the raw shape the runner folds, from a commit-page Result for id. r/ok -> the place-one answer with :moved? mirroring :placed?. An outcome that is already raw (a prepare that threw) is kept. A :collector/not-found err is a skip (entries/relocate-entry! answers it the same way); any other err is a named failure.

Pure: the raw shape the runner folds, from a `commit-page` Result for `id`.
r/ok -> the place-one answer with :moved? mirroring :placed?. An outcome
that is already raw (a prepare that threw) is kept. A :collector/not-found
err is a skip (`entries/relocate-entry!` answers it the same way); any
other err is a named failure.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close