solution: can stream to a Pulsar topic#25
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new streaming “write-only” storage target backed by Apache Pulsar, enabling the stream command to publish per-field messages to a topic-per-field layout instead of writing files.
Changes:
- Introduce
PulsarStorage(WriteTargetonly) that pre-creates one producer per field topic and publishes encodedArchiveRowdata as Pulsar messages. - Add a streaming encoder (
formats::stream) that converts anArchiveRowinto per-field broker messages with metadata properties (e.g.,dedup-key,height,tx-index). - Refactor
stream --continuelogic into a pluggable resume strategy (archiver::resume) and wire a separate dispatch path for write-only targets.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/storage/pulsar.rs | New Pulsar write-only storage backend + end-to-end container test publishing to per-field topics. |
| src/storage/mod.rs | Exposes the Pulsar module and adds is_pulsar/create_pulsar helpers for CLI dispatch. |
| src/record.rs | Adds Field::name() as a stable external label used by streaming layout. |
| src/main.rs | Adds Pulsar-specific command restrictions and a write-only dispatch path; wires streaming target selection. |
| src/formats/stream.rs | New per-row streaming message encoding with topic labels, partition keying, and metadata properties. |
| src/formats/mod.rs | Exposes the new stream format module. |
| src/command/stream.rs | Generalizes StreamCommand over WriteTarget and plugs in optional resume strategy for --continue. |
| src/args.rs | Adds --stream.url / --stream.topics CLI options for selecting a streaming target. |
| src/archiver/resume.rs | New resume strategy abstraction and ScanResume implementation for file-based targets. |
| src/archiver/mod.rs | Exposes the new resume module and re-exports resume types. |
| src/archiver/archiver.rs | Replaces derive(Clone) with a manual Clone impl to avoid unnecessary trait bounds. |
Comments suppressed due to low confidence (1)
src/main.rs:319
StreamCommand::newreturns aResult(and can reject--continuefor write-only targets), but this unwrap will panic if it ever returns an error. Prefer propagating the error (e.g., makestream_write_onlyreturnResultand use?) so unsupported combinations fail gracefully.
async fn stream_write_only(self, args: &Args) -> StreamCommand<B, TS> {
let notifier = self.parent.parent.notifier.unwrap();
let notifications = notifier.start();
let archiver = Archiver::new(
Arc::new(self.parent.target), Arc::new(self.data), notifications
);
let command = StreamCommand::new(&args, archiver).await.unwrap();
command
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 26834588277Coverage decreased (-1.0%) to 48.723%Details
Uncovered Changes
Coverage Regressions17 previously-covered lines in 11 files lost coverage.
Coverage Stats
💛 - Coveralls |
solution: wrap the original data in a JSON with metadata
…at breaks the order in Pulsar topic solution: option to have infinite retry, enabled by default for streaming
solution: a Cancellation token fired on a reorg
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.
No description provided.