feat: standalone precompute engine replacing Arroyo streaming pipeline#228
Merged
milindsrivastava1997 merged 12 commits intomainfrom Mar 31, 2026
Merged
feat: standalone precompute engine replacing Arroyo streaming pipeline#228milindsrivastava1997 merged 12 commits intomainfrom
milindsrivastava1997 merged 12 commits intomainfrom
Conversation
Implements a single-node multi-threaded precompute engine as a new module and binary target within QueryEngineRust. The engine ingests Prometheus remote write samples, buffers them per-series with out-of-order handling, detects closed tumbling/sliding windows via event-time watermarks, feeds samples into accumulator wrappers for all existing sketch types, and emits PrecomputedOutput directly to the store. New modules: config, series_buffer, window_manager, accumulator_factory, series_router, worker, output_sink, and the PrecomputeEngine orchestrator. The binary supports embedded store + query HTTP server for single-process deployment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace sketch_db_common::enums::QueryLanguage import with query_engine_rust::data_model::QueryLanguage in the standalone binary, and integrate PrecomputeEngine into main.rs as an alternative to the removed PrometheusRemoteWriteServer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Handle top-level aggregation types (DatasketchesKLL, Sum, Min, Max, etc.) directly in the factory match, fixing the fallback to Sum that broke quantile queries. Also preserve the K parameter in KllAccumulatorUpdater::reset() instead of hardcoding 200. Add test_e2e_precompute binary that validates the full ingest -> precompute -> store -> query pipeline end-to-end. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When pass_raw_samples is enabled, each incoming sample is emitted directly to the store as a SumAccumulator without windowing or watermark advancement. This supports use cases where raw passthrough is needed instead of sketch-based aggregation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…te engine Instrument the ingest→worker→store pipeline with debug_span! and an Instant-based e2e latency log. All spans are at debug level so there is zero overhead at the default info level. Enable FmtSpan::CLOSE in both binaries to emit span durations when RUST_LOG=debug. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rfile dependency cache layer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and apply fmt - Restore decode_prometheus_remote_write and related types that were fully commented out in prometheus_remote_write.rs - Fix CountMinSketchAccumulator field access via .inner. in accumulator_factory - Fix AggregationConfig::new call in worker test (missing slide_interval arg, wrong types for spatial_filter/metric, extra trailing None) - Apply cargo fmt across precompute engine files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
eeba11e to
8af309b
Compare
The sketch field on CountMinSketch is a method not a field; replace the manual xxhash loop in CountMinSketchUpdater::update_keyed with a call to acc.inner.update() which encapsulates the same logic. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused `serde_json::json` import in worker.rs test - Add `Default` impls for SumAccumulatorUpdater, IncreaseAccumulatorUpdater, MultipleSumUpdater, MultipleIncreaseUpdater, NoopOutputSink - Suppress `too_many_arguments` on Worker::new Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a "Why not ArroyoSketch?" subsection to the "Why this PR is needed" section of the precompute engine design doc, with a comparison table and prose explaining the operational tradeoffs between the two approaches. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
milindsrivastava1997
approved these changes
Mar 31, 2026
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.
Summary
PrecomputeEnginewith configurable worker pool,SeriesRouter,WindowManager, andSeriesBufferDatasketchesKLLaccumulator inAccumulatorFactorywith E2E test--enable-prometheus-remote-writeflagThis is PR A of 6 stacked PRs splitting #162
Stacking order:
Test plan
cargo buildcompiles successfullycargo run --bin test_e2e_precompute--enable-prometheus-remote-writeis passed