Liking cljdoc? Tell your friends :D

hive-milvus.relocate.pipeline

PIPELINE: compose the collectors + promoters + boundaries into the single-entry relocate operation. All-Result; first :err short-circuits.

The flow:

collect-existing-entry ;; COLLECT → compute-target ;; PROMOTE (pure) → classify-relocation-need ;; PROMOTE (pure) → IF :no-op → return r/ok with :moved? false IF :move → ensure-target-collection ;; PROMOTE/BOUNDARY edge → build-target-record ;; PROMOTE (calls embedder) → milvus-write! ;; BOUNDARY → milvus-delete! ;; BOUNDARY → return r/ok with :moved? true

Replaces the body of hive-milvus.store.entries/relocate-entry! with a Result-tracked, layer-disciplined version.

PIPELINE: compose the collectors + promoters + boundaries into the
single-entry relocate operation. All-Result; first :err short-circuits.

The flow:

  collect-existing-entry           ;; COLLECT
    → compute-target               ;; PROMOTE (pure)
    → classify-relocation-need     ;; PROMOTE (pure)
    → IF :no-op → return r/ok with :moved? false
      IF :move  → ensure-target-collection  ;; PROMOTE/BOUNDARY edge
                → build-target-record       ;; PROMOTE (calls embedder)
                → milvus-write!              ;; BOUNDARY
                → milvus-delete!             ;; BOUNDARY
                → return r/ok with :moved? true

Replaces the body of `hive-milvus.store.entries/relocate-entry!`
with a Result-tracked, layer-disciplined version.
raw docstring

copy-oneclj

(copy-one config-atom id)

Copy the entry at id into its canonical collection, LEAVING the source row in place. Non-destructive: the old collection remains a complete backup.

Copy the entry at `id` into its canonical collection, LEAVING the source row
in place. Non-destructive: the old collection remains a complete backup.
sourceraw docstring

delete-sourceclj

(delete-source)

Move: the source row is removed once the target write has landed.

Move: the source row is removed once the target write has landed.
sourceraw docstring

ISourceDispositioncljprotocol

-after-writeclj

(-after-write this bundle)

What becomes of the source row once the target write has landed.

What becomes of the source row once the target write has landed.

-describe-dispositionclj

(-describe-disposition this)
source

keep-sourceclj

(keep-source)

Copy: the source row is left exactly where it is. The old collection stays a readable backup, at the cost of holding the entry twice.

Copy: the source row is left exactly where it is. The old collection stays a
readable backup, at the cost of holding the entry twice.
sourceraw docstring

place-oneclj

(place-one config-atom id disposition)

Put the entry at id into its canonical collection, then let disposition decide what happens to the source row.

Returns: (r/ok {:placed? true :source-kept? bool :from src :to target :id id}) (r/ok {:placed? false :from src :to target :id id}) on no-op (r/err :collector/not-found | :routing/no-target | :embedder/embed-failed | :boundary/milvus-write-failed | …)

Idempotent: the target write is an upsert, and an entry already in its canonical collection is a no-op.

Put the entry at `id` into its canonical collection, then let `disposition`
decide what happens to the source row.

Returns:
  (r/ok {:placed? true  :source-kept? bool :from src :to target :id id})
  (r/ok {:placed? false :from src :to target :id id})          on no-op
  (r/err :collector/not-found | :routing/no-target |
         :embedder/embed-failed | :boundary/milvus-write-failed | …)

Idempotent: the target write is an upsert, and an entry already in its
canonical collection is a no-op.
sourceraw docstring

relocate-oneclj

(relocate-one config-atom id)

Relocate the entry at id to its canonical collection, REMOVING it from the source. See place-one; :moved? mirrors :placed? for legacy callers.

Relocate the entry at `id` to its canonical collection, REMOVING it from the
source. See `place-one`; `:moved?` mirrors `:placed?` for legacy callers.
sourceraw docstring

relocate-updateclj

(relocate-update config-atom id updates)

Update-with-relocation: merge updates into the entry, recompute its target collection from the merged shape, and either upsert in place (target == src) or move via relocate-one (target ≠ src).

Replaces the body of entries/update-entry! for the routing-aware path. Returns r/ok merged-entry on success or r/err on failure.

Note: relocate-one only relocates the entry as it CURRENTLY is. When updates change the :type and the new :type routes to a different collection, we do NOT use relocate-one — we explicitly write the merged entry to the new collection, then delete from src. This subtle difference is why relocate-update is its own fn rather than a wrapper over relocate-one.

Update-with-relocation: merge `updates` into the entry, recompute
its target collection from the merged shape, and either upsert in
place (target == src) or move via `relocate-one` (target ≠ src).

Replaces the body of `entries/update-entry!` for the routing-aware
path. Returns r/ok merged-entry on success or r/err on failure.

Note: `relocate-one` only relocates the entry as it CURRENTLY is.
When updates change the :type and the new :type routes to a
different collection, we do NOT use relocate-one — we explicitly
write the merged entry to the new collection, then delete from src.
This subtle difference is why `relocate-update` is its own fn
rather than a wrapper over `relocate-one`.
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