Skip to content

Commit 4af8953

Browse files
zzylolclaude
andcommitted
refactor: switch consumer imports to asap_sketchlib::sketches::*
Update PR #307 against the reorganized asap_sketchlib (PR #36) — runtime sketches now live in the existing src/sketches/ layout (single home per sketch concept), not under a separate `asap::` namespace. Path swaps in asap-query-engine (legacy fork; smaller surface than ASAPQuery-backend — no DDSketch / CountSketch / HllSketch accumulators): - asap_sketchlib::asap::count_min::* → ::sketches::countmin::* - asap_sketchlib::asap::kll::* → ::sketches::kll::* - asap_sketchlib::asap::count_min_with_heap::* → ::sketches::cms_heap::* - asap_sketchlib::asap::hydra_kll::* → ::sketches::hydra_kll::* - asap_sketchlib::asap::set_aggregator::* → ::sketches::set_aggregator::* - asap_sketchlib::asap::delta_set_aggregator::* → ::sketches::delta_set_aggregator::* - asap_sketchlib::asap::config::* → ::asap_runtime::* Rename carried through: - HeapItem → CmsHeapItem (avoids common::input::HeapItem collision) main.rs aliases asap_runtime as `config` so existing clap-derive references keep working. Tests: - cargo check -p query_engine_rust → clean - cargo test -p query_engine_rust --lib precompute_operators → 87 passed, 0 failed Depends on ProjectASAP/asap_sketchlib#36 (force-pushed e473ccc). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5f50ff9 commit 4af8953

13 files changed

Lines changed: 40 additions & 294 deletions

Cargo.lock

Lines changed: 5 additions & 167 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asap-query-engine/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ urlencoding = "2.1"
3838
flate2 = "1.0"
3939
async-trait = "0.1"
4040
xxhash-rust = { version = "0.8", features = ["xxh32", "xxh64"] }
41-
dsrs = { git = "https://github.com/ProjectASAP/datasketches-rs", rev = "d748ec75c80fff21f7b24897244dd1c895df2e9a" }
4241
base64 = "0.21"
4342
hex = "0.4"
4443
sqlparser = "0.59.0"
@@ -59,7 +58,7 @@ tracing-appender = "0.2"
5958
arc-swap = "1"
6059
csv = "1"
6160
elastic_dsl_utilities.workspace = true
62-
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib", branch = "refactor/adopt-sketch-core-modules", features = ["asap-cli"] }
61+
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib", branch = "refactor/adopt-sketch-core-modules" }
6362

6463
[[bin]]
6564
name = "precompute_engine"
@@ -78,7 +77,6 @@ name = "e2e_quickstart_resource_test"
7877
path = "src/bin/e2e_quickstart_resource_test.rs"
7978

8079
[dev-dependencies]
81-
ctor = "0.2"
8280
tempfile = "3.20.0"
8381
criterion = { version = "0.5", features = ["html_reports"] }
8482

@@ -93,4 +91,3 @@ default = []
9391
lock_profiling = []
9492
# Enable extra debugging output
9593
extra_debugging = []
96-
sketchlib-tests = []

asap-query-engine/src/lib.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
#[cfg(test)]
2-
#[ctor::ctor]
3-
fn init_sketch_backend_for_tests() {
4-
#[cfg(feature = "sketchlib-tests")]
5-
let _ = asap_sketchlib::asap::config::configure(
6-
asap_sketchlib::asap::config::ImplMode::Sketchlib,
7-
asap_sketchlib::asap::config::ImplMode::Legacy,
8-
asap_sketchlib::asap::config::ImplMode::Sketchlib,
9-
);
10-
#[cfg(not(feature = "sketchlib-tests"))]
11-
asap_sketchlib::asap::config::force_legacy_mode_for_tests();
12-
}
13-
141
pub mod data_model;
152
pub mod drivers;
163
pub mod engines;

asap-query-engine/src/main.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use std::sync::{Arc, RwLock};
55
use tokio::signal;
66
use tracing::{debug, error, info, warn};
77

8-
use asap_sketchlib::asap::config::{self, ImplMode};
9-
108
use asap_types::streaming_config::StreamingConfig;
119
use query_engine_rust::data_model::enums::{
1210
CleanupPolicy, InputFormat, LockStrategy, StreamingEngine,
@@ -115,18 +113,6 @@ struct Args {
115113
#[arg(long)]
116114
promsketch_config: Option<String>,
117115

118-
/// Backend implementation for Count-Min Sketch (legacy | sketchlib)
119-
#[arg(long, value_enum, default_value_t = config::DEFAULT_CMS_IMPL)]
120-
sketch_cms_impl: ImplMode,
121-
122-
/// Backend implementation for KLL Sketch (legacy | sketchlib)
123-
#[arg(long, value_enum, default_value_t = config::DEFAULT_KLL_IMPL)]
124-
sketch_kll_impl: ImplMode,
125-
126-
/// Backend implementation for Count-Min-With-Heap (legacy | sketchlib)
127-
#[arg(long, value_enum, default_value_t = config::DEFAULT_CMWH_IMPL)]
128-
sketch_cmwh_impl: ImplMode,
129-
130116
/// Enable OTLP metrics ingest (gRPC + HTTP)
131117
#[arg(long)]
132118
enable_otel_ingest: bool,
@@ -206,14 +192,6 @@ struct Args {
206192
async fn main() -> Result<()> {
207193
let args = Args::parse();
208194

209-
// Configure sketch-core backends before any sketch operations.
210-
config::configure(
211-
args.sketch_cms_impl,
212-
args.sketch_kll_impl,
213-
args.sketch_cmwh_impl,
214-
)
215-
.expect("sketch backend already initialised");
216-
217195
// Create output directory
218196
fs::create_dir_all(&args.output_dir)?;
219197

asap-query-engine/src/precompute_engine/worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ mod tests {
776776
use crate::precompute_operators::datasketches_kll_accumulator::DatasketchesKLLAccumulator;
777777
use crate::precompute_operators::multiple_sum_accumulator::MultipleSumAccumulator;
778778
use crate::precompute_operators::sum_accumulator::SumAccumulator;
779-
use asap_sketchlib::asap::kll::KllSketch;
779+
use asap_sketchlib::sketches::kll::KllSketch;
780780
use asap_types::enums::{AggregationType, WindowType};
781781

782782
fn make_agg_config(

0 commit comments

Comments
 (0)