Container builders for the persist source#36514
Open
antiguru wants to merge 1 commit into
Open
Conversation
6e6d122 to
4515d68
Compare
Generalize `persist_source` over container builders for the row and error outputs, replacing the hardcoded `Vec<(_, Timestamp, Diff)>` containers with caller-supplied `DCB` and `ECB` type parameters that implement `ContainerBuilder + PushInto<(_, Timestamp, Diff)>`. The ok/err demux switches from `ok_err` to a `unary_fallible` operator parameterized over these builders so finished batches flow through the chosen builder. Existing callers in `storage` and `compute` pass `CapacityContainerBuilder<_>` to preserve current behavior. Supporting changes: * `txn-wal::operator::txns_progress` and `txns_progress_frontiers` accept a generic `Stream<_, P: Container>` rather than `StreamVec`, and the frontier operator uses the new `NoopContainerBuilder` since it forwards whole containers without building from elements. * Add `NoopContainerBuilder` to `mz-timely-util::containers` for the pass-through case where only whole containers exist. * Relax `AsyncOutputHandle::give_container` and the async input handles in `builder_async` to operate over any `ContainerBuilder` / `Container`, not just `CapacityContainerBuilder<C>` / `C: Clone`.
4515d68 to
ef9e048
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The persist source hardcodes its row and error outputs to
Vec<(_, Timestamp, Diff)>containers, which forces every downstream operator to consume that exact shape and prevents callers from selecting a more suitable container builder (e.g. for columnar batches).Description
Generalize
persist_sourceover caller-supplied container buildersDCB/ECB(eachContainerBuilder + PushInto<(_, Timestamp, Diff)>) and switch the ok/err demux fromok_errto aunary_fallibleoperator parameterized over them. All current callers passCapacityContainerBuilder<_>to preserve existing behavior.Supporting changes propagate the same generalization through
txn-wal::operator::txns_progressandtxns_progress_frontiers(now overStream<_, P: Container>), relaxbuilder_async's output/input handles to accept anyContainerBuilder/Container, and add aNoopContainerBuilderinmz-timely-util::containersfor the pass-through case.See the commit message for the full breakdown.