Expand description
Write sink.
Where writes go, isolated from how routing is decided
(docs/decisions/008). The Sink trait is the seam: OpenSearchSink
writes directly to a cluster, and the future queue-based redundancy mode is a
QueueSink drop-in behind the same trait. Epoch stamping is carried on every
WriteOp at this boundary (docs/06 §2).
M1 ships the Sink trait, the WriteBatch/WriteAck vocabulary, an
in-memory MemorySink for tests and dry-run, and the OpenSearchSink
that writes directly to a cluster over a pooled HTTP connection. M2 adds the
Reader seam for get-by-id reads (kept separate because a read is always
direct-to-cluster, a redundancy QueueSink can absorb writes but cannot
answer a read); both MemorySink and OpenSearchSink implement it.
Structs§
- Count
Outcome - The outcome of a count: the upstream status and the matched document count.
- Cursor
Op - A raw cursor passthrough op (
docs/03§6): forwardmethod pathwithbodyto the specificclusterthe cursor is pinned to, scroll/PIT continue, clear, or close. Unlike the typed ops, the destination is already resolved (the engine recovered it from the cursor’s signed envelope), so this carries the cluster directly rather than a partition. - Cursor
Outcome - The outcome of a cursor passthrough: the upstream status and raw body, forwarded back to the client verbatim.
- Forward
Op - A verbatim forward whose request body is a stream, not buffered bytes
(ADR-014 stage 2): the same destination shape as
CursorOpbut the body is supplied separately as aByteBodyso it can be piped from the downstream connection straight to the upstream without ever being collected. Used by the tenant-agnostic passthrough path. - Memory
Sink - A non-persistent
Sink/Readerthat records batches, stores indexed documents, and acknowledges success. - OpResult
- The outcome of a single operation in a batch, positionally aligned with the
batch’s operations (so a
_bulkresponse can be re-interleaved in M3). - Open
Search Sink - A
Sinkthat writes directly to OpenSearch clusters over pooled HTTP. - Pool
Stats - A snapshot of one cluster pool’s connection-reuse counters.
- ReadOp
- A read-by-id operation against a resolved
Target. - Read
Outcome - The outcome of a read: whether the document was found, and its raw upstream body (the document as stored, before the read-path field strip).
- Search
Op - A search operation against a resolved
Target. - Search
Outcome - The outcome of a search: the upstream status and raw response body (the hits, before the read-path field strip).
- Streaming
Forward - The outcome of a streaming verbatim forward (ADR-014): the upstream status
and its response body as a live
ByteBodystream, piped back to the client without ever being collected. UnlikeCursorOutcome, the body is not materialized here, so this carries no derives (the stream is one-shot). - Streaming
Search - The outcome of a streaming search (ADR-014, final stage): the upstream
status and its response body as a live
ByteBody, piped back through the engine’s hit transform without ever being collected. LikeStreamingForward, the body is one-shot, so this carries no derives. - Write
Ack - The acknowledgement for a whole batch: one
OpResultper operation, in the batch’s original order. - Write
Batch - A batch of operations destined for one target.
- WriteOp
- A single write operation against a resolved
Target.
Enums§
- DocOp
- A document-level operation: the already-transformed body plus the
constructed id/routing (the tenancy rewrite has already run,
docs/04). - Sink
Error - A failure applying a write at the sink.
Traits§
Functions§
- buffered
- Wraps fully-buffered bytes as a
ByteBody. The buffered body is infallible;match never {}discharges itsInfallibleerror intoBodyError. - stream_
body - Adapts any streaming body into a
ByteBody, e.g. the downstreamhyper::body::Incomingfor a verbatim forward or a streamed_bulk, so its bytes flow through the proxy without buffering (ADR-014).
Type Aliases§
- Body
Error - The error type the upstream body may surface. A buffered body never errors
(
Infallible); a streamed verbatim-forward body surfaces the downstream read error here. Boxed so both fit one client type. - Byte
Body - A boxed byte-stream body, used both for the request sent to an upstream
cluster and as the carrier for a downstream body streamed through the proxy
(a verbatim forward, or a
_bulkbatch the engine frames). Boxed (unsync, the pooled client needs onlySend, notSync) so one type covers buffered bytes, a stream, or a head + stream-tail without changing the pooled client’s type, and so a downstreamhyper::body::Incoming(which isSendbut notSync) can be piped straight through (ADR-014).