Separate chunker from batcher#625
Open
antiguru wants to merge 1 commit intoTimelyDataflow:master-nextfrom
Open
Separate chunker from batcher#625antiguru wants to merge 1 commit intoTimelyDataflow:master-nextfrom
antiguru wants to merge 1 commit intoTimelyDataflow:master-nextfrom
Conversation
b559eb0 to
237a915
Compare
237a915 to
b477035
Compare
The chunker was part of the batcher and responsible for transforming input data into the batcher's chain format. Hence, the batcher needed to be aware of its input types, although it would not otherwise use this information. Drop the `Input` and `C` type parameters from `MergeBatcher`, and the `Input` associated type plus `push_container` method from the `Batcher` trait. Batchers now accept chunks via `PushInto<Self::Output>`. Chunking moves into `arrange_core`, which gains a `Chu: ContainerBuilder` type parameter so callers can supply a chunker that maps the stream's input container into the batcher's output container. The `Arrange` trait constrains `Ba::Output = C` (same-type chunker) and hardcodes `ContainerChunker<C>` internally, so `.arrange::<Ba, Bu, Tr>()` callsites for `Vec`-based collections are unchanged. Callers that need a cross-container chunker (columnar layouts, interactive) drop to `arrange_core` directly. Also updates `chainless_batcher::Batcher` to the new `Batcher` trait shape, and replaces `batcher.push_container(&mut vec\![..])` with `batcher.push_into(vec\![..])` in the trace test. Signed-off-by: Moritz Hoffmann <antiguru@gmail.com>
b477035 to
523a501
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.
The chunker was part of the batcher and responsible for transforming input data into the batcher's chain format. Hence, the batcher needed to be aware of its input types, although it would not otherwise use this information.
This change drops the
InputandCtype parameters fromMergeBatcher, and theInputassociated type pluspush_containermethod from theBatchertrait. Batchers now accept chunks viaPushInto<Self::Output>. Chunking moves intoarrange_core, which gains aChu: ContainerBuildertype parameter so callers can supply a chunker that maps the stream's input container into the batcher's output container.The
Arrangetrait constrainsBa::Output = C(same-type chunker) and hardcodesContainerChunker<C>internally, so.arrange::<Ba, Bu, Tr>()callsites forVec-based collections are unchanged. Callers that need a cross-container chunker (columnar layouts, interactive) drop toarrange_coredirectly.Also updates
chainless_batcher::Batcherto the newBatchertrait shape.