From 869ebb4da8f98a86e49d47cf7ea9d129868c6e64 Mon Sep 17 00:00:00 2001 From: zz_y Date: Tue, 21 Jul 2026 08:41:53 -0600 Subject: [PATCH] chore: retire promql_utilities crate, move AggregationType into asap_types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit promql_utilities had shrunk to a single type (AggregationType, 162 lines) after prior stages of the sketch-identity unification moved everything else out. asap_types was already the only crate depending on it and already re-exported the type, so the separate crate boundary served no purpose. Moves AggregationType verbatim into crates/asap_types/src/aggregation_type.rs, repoints all import sites across data_plane/control_plane, and deletes the crate. Pure structural move — AggregationType's variants and semantics are unchanged. Co-Authored-By: Claude Sonnet 5 --- Cargo.lock | 27 ------------------- Cargo.toml | 2 -- control_plane/Cargo.toml | 1 - control_plane/src/asap_tier_analysis.rs | 8 +++--- .../src/sketch_algebra/capability.rs | 2 +- .../src/sketch_algebra/physical_expr.rs | 2 +- .../sketch_algebra/rules/bind_exact_agg.rs | 2 +- control_plane/src/sketch_algebra/tests.rs | 23 +++++++--------- control_plane/src/sketch_selection.rs | 2 +- crates/asap_types/Cargo.toml | 1 - crates/asap_types/src/aggregation_config.rs | 2 +- .../src/aggregation_type.rs} | 20 ++++++++++++++ crates/asap_types/src/capability_matching.rs | 2 +- crates/asap_types/src/enums.rs | 3 --- crates/asap_types/src/lib.rs | 2 ++ crates/asap_types/src/policy_fingerprint.rs | 2 +- crates/asap_types/src/policy_registry.rs | 2 +- crates/promql_utilities/.gitignore | 1 - crates/promql_utilities/Cargo.toml | 20 -------------- crates/promql_utilities/src/lib.rs | 3 --- .../promql_utilities/src/query_logics/mod.rs | 3 --- data_plane/Cargo.toml | 1 - data_plane/benches/sketch_db.rs | 3 ++- data_plane/src/drivers/ingest/otel.rs | 9 ++++--- data_plane/src/drivers/query/servers/http.rs | 5 ++-- .../precompute_engine/accumulator_factory.rs | 3 ++- .../src/precompute_engine/ingest_handler.rs | 3 ++- .../operators/sketch_envelope_accumulator.rs | 2 +- .../src/precompute_engine/output_sink.rs | 2 +- data_plane/src/precompute_engine/worker.rs | 3 ++- .../src/storage_engines/sketch_db/accuracy.rs | 2 +- .../sketch_db/backfill/processor.rs | 3 ++- .../sketch_db/backfill/service.rs | 3 ++- .../sketch_db/backfill/window_builder.rs | 3 ++- .../src/storage_engines/sketch_db/data/mod.rs | 2 +- .../sketch_db/lifecycle/reconcile.rs | 3 ++- data_plane/src/storage_engines/types/enums.rs | 2 +- .../types/hot_reload_config.rs | 3 ++- .../src/storage_engines/types/traits.rs | 2 +- .../accuracy_empirical_validation_tests.rs | 2 +- .../tests/e2e_modified_otlp_sketch_path.rs | 3 ++- 41 files changed, 79 insertions(+), 110 deletions(-) rename crates/{promql_utilities/src/query_logics/enums.rs => asap_types/src/aggregation_type.rs} (84%) delete mode 100644 crates/promql_utilities/.gitignore delete mode 100644 crates/promql_utilities/Cargo.toml delete mode 100644 crates/promql_utilities/src/lib.rs delete mode 100644 crates/promql_utilities/src/query_logics/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 02889cab..aef78304 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -410,7 +410,6 @@ version = "0.1.0" dependencies = [ "anyhow", "clap 4.6.1", - "promql_utilities", "serde", "serde_json", "serde_yaml", @@ -791,7 +790,6 @@ dependencies = [ "parking_lot", "prometheus", "promql-parser 0.8.0", - "promql_utilities", "prost", "prost-build", "reqwest 0.12.28", @@ -1000,7 +998,6 @@ dependencies = [ "moka", "prometheus", "promql-parser 0.5.1", - "promql_utilities", "prost", "regex", "reqwest 0.11.27", @@ -2481,19 +2478,6 @@ dependencies = [ "regex", ] -[[package]] -name = "promql_utilities" -version = "0.1.0" -dependencies = [ - "chrono", - "promql-parser 0.5.1", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio-test", - "tracing", -] - [[package]] name = "prost" version = "0.13.5" @@ -3610,17 +3594,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-test" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6d24790a10a7af737693a3e8f1d03faef7e6ca0cc99aae5066f533766de545" -dependencies = [ - "futures-core", - "tokio", - "tokio-stream", -] - [[package]] name = "tokio-tungstenite" version = "0.21.0" diff --git a/Cargo.toml b/Cargo.toml index 0e6b9c80..9c031281 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,6 @@ [workspace] resolver = "2" members = [ - "crates/promql_utilities", "crates/asap_otel_proto", "crates/asap_types", "data_plane", @@ -44,7 +43,6 @@ tokio = { version = "1.0", features = ["full"] } arc-swap = "1.7" # Internal crates -promql_utilities = { path = "crates/promql_utilities" } asap_types = { path = "crates/asap_types" } asap_otel_proto = { path = "crates/asap_otel_proto" } indexmap = { version = "2.0", features = ["serde"] } diff --git a/control_plane/Cargo.toml b/control_plane/Cargo.toml index ae3c41b1..4a72e880 100644 --- a/control_plane/Cargo.toml +++ b/control_plane/Cargo.toml @@ -32,7 +32,6 @@ parking_lot = "0.12" prometheus = { version = "0.13", default-features = false, features = ["process"] } tonic = { version = "0.12", features = ["gzip"] } tokio-stream = { version = "0.1", features = ["net"] } -promql_utilities.workspace = true asap_types.workspace = true # Transitional pin (docs/migration-plan-backend-plan.md Phase 1b): locked to a diff --git a/control_plane/src/asap_tier_analysis.rs b/control_plane/src/asap_tier_analysis.rs index 6d448da1..4ef8dd74 100644 --- a/control_plane/src/asap_tier_analysis.rs +++ b/control_plane/src/asap_tier_analysis.rs @@ -651,7 +651,7 @@ fn duration_to_seconds(d: Duration) -> u64 { /// serve any ASAP-tier candidate" and skip. pub fn policy_capability(cfg: &asap_types::AggregationConfig) -> Option { use crate::sketch_algebra::capability::SketchKindHandle; - use promql_utilities::query_logics::enums::AggregationType; + use asap_types::AggregationType; match cfg.aggregation_type { // Exact-aggregation families — the ASAP-tier ExactAgg path. AggregationType::Sum => Some(Capability::ExactAgg(AggregationType::Sum)), @@ -735,7 +735,7 @@ pub fn find_policy_by_content( registry: &asap_types::PolicyRegistry, metric: &str, group_by_keys: &BTreeSet, - agg_type: promql_utilities::query_logics::enums::AggregationType, + agg_type: asap_types::AggregationType, expected_params: &std::collections::HashMap, ) -> Option { let mut hit: Option = None; @@ -833,7 +833,7 @@ pub fn find_matching_policies( #[cfg(test)] mod tests { use super::*; - use promql_utilities::query_logics::enums::AggregationType; + use asap_types::AggregationType; fn keys(items: &[&str]) -> BTreeSet { items.iter().map(|s| s.to_string()).collect() @@ -1420,9 +1420,9 @@ mod tests { mod matching { use super::super::*; + use asap_types::AggregationType; use asap_types::KeyByLabelNames; use asap_types::{AggregationConfig, PolicyFingerprint, PolicyRegistry}; - use promql_utilities::query_logics::enums::AggregationType; use std::collections::HashMap; fn cfg( diff --git a/control_plane/src/sketch_algebra/capability.rs b/control_plane/src/sketch_algebra/capability.rs index 849aa36f..f3ed639a 100644 --- a/control_plane/src/sketch_algebra/capability.rs +++ b/control_plane/src/sketch_algebra/capability.rs @@ -22,7 +22,7 @@ use crate::intent_algebra::agg_intent::AggIntent; use crate::types_v2::AccuracyTarget; -use promql_utilities::query_logics::enums::AggregationType; +use asap_types::AggregationType; // ── Query-side capability tag ──────────────────────────────────────────────── diff --git a/control_plane/src/sketch_algebra/physical_expr.rs b/control_plane/src/sketch_algebra/physical_expr.rs index c80eadb9..22d78252 100644 --- a/control_plane/src/sketch_algebra/physical_expr.rs +++ b/control_plane/src/sketch_algebra/physical_expr.rs @@ -22,7 +22,7 @@ use serde::{Deserialize, Serialize}; use crate::intent_algebra::QueryExpr; use crate::types_v2::BindingName; -use promql_utilities::query_logics::enums::AggregationType; +use asap_types::AggregationType; /// Readout operation extracted from a built sketch state. Inverse of /// `SketchAgg`. Mirrors design.md §6 line ~607 — `SketchEstimate` plus diff --git a/control_plane/src/sketch_algebra/rules/bind_exact_agg.rs b/control_plane/src/sketch_algebra/rules/bind_exact_agg.rs index 09f215cf..026fb98f 100644 --- a/control_plane/src/sketch_algebra/rules/bind_exact_agg.rs +++ b/control_plane/src/sketch_algebra/rules/bind_exact_agg.rs @@ -54,7 +54,7 @@ use std::time::Duration; -use promql_utilities::query_logics::enums::AggregationType; +use asap_types::AggregationType; use crate::intent_algebra::{AggIntent, QueryExpr}; use crate::sketch_algebra::physical_expr::PhysicalExpr; diff --git a/control_plane/src/sketch_algebra/tests.rs b/control_plane/src/sketch_algebra/tests.rs index 94856661..46f8ea96 100644 --- a/control_plane/src/sketch_algebra/tests.rs +++ b/control_plane/src/sketch_algebra/tests.rs @@ -327,7 +327,7 @@ fn sum_now_binds_to_exact_agg_after_pr_6_followup() { match bound { PhysicalExpr::ExactAgg { agg_type, .. } => assert_eq!( agg_type, - promql_utilities::query_logics::enums::AggregationType::Sum, + asap_types::AggregationType::Sum, "Sum should bind to ExactAgg(Sum)" ), other => panic!("expected ExactAgg, got {other:?}"), @@ -405,10 +405,9 @@ fn phase_b_pattern_only_temporal_sum_binds_to_exact_agg() { }; let bound = bind_query_expr(&expr, AccuracyTarget::Epsilon(0.01)).unwrap(); match bound { - PhysicalExpr::ExactAgg { agg_type, .. } => assert_eq!( - agg_type, - promql_utilities::query_logics::enums::AggregationType::Sum, - ), + PhysicalExpr::ExactAgg { agg_type, .. } => { + assert_eq!(agg_type, asap_types::AggregationType::Sum,) + } other => panic!("expected ExactAgg(Sum), got {other:?}"), } } @@ -429,10 +428,9 @@ fn phase_b_pattern_only_spatial_aggregate_binds_to_multiple_sum() { }; let bound = bind_query_expr(&expr, AccuracyTarget::Epsilon(0.01)).unwrap(); match bound { - PhysicalExpr::ExactAgg { agg_type, .. } => assert_eq!( - agg_type, - promql_utilities::query_logics::enums::AggregationType::MultipleSum, - ), + PhysicalExpr::ExactAgg { agg_type, .. } => { + assert_eq!(agg_type, asap_types::AggregationType::MultipleSum,) + } other => panic!("expected ExactAgg(MultipleSum), got {other:?}"), } } @@ -450,10 +448,9 @@ fn phase_b_pattern_temporal_and_spatial_combined_binds_to_multiple_increase() { }; let bound = bind_query_expr(&expr, AccuracyTarget::Epsilon(0.01)).unwrap(); match bound { - PhysicalExpr::ExactAgg { agg_type, .. } => assert_eq!( - agg_type, - promql_utilities::query_logics::enums::AggregationType::MultipleIncrease, - ), + PhysicalExpr::ExactAgg { agg_type, .. } => { + assert_eq!(agg_type, asap_types::AggregationType::MultipleIncrease,) + } other => panic!("expected ExactAgg(MultipleIncrease), got {other:?}"), } } diff --git a/control_plane/src/sketch_selection.rs b/control_plane/src/sketch_selection.rs index c7a7df3f..78a6c136 100644 --- a/control_plane/src/sketch_selection.rs +++ b/control_plane/src/sketch_selection.rs @@ -94,7 +94,7 @@ fn concrete_or(h: SketchKindHandle, any_set: &[SketchType]) -> Vec { #[cfg(test)] mod tests { use super::*; - use promql_utilities::query_logics::enums::AggregationType; + use asap_types::AggregationType; #[test] fn quantile_any_expands_to_ddsketch_and_kll() { diff --git a/crates/asap_types/Cargo.toml b/crates/asap_types/Cargo.toml index ed316da6..31731c99 100644 --- a/crates/asap_types/Cargo.toml +++ b/crates/asap_types/Cargo.toml @@ -4,7 +4,6 @@ version.workspace = true edition.workspace = true [dependencies] -promql_utilities.workspace = true tracing.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/crates/asap_types/src/aggregation_config.rs b/crates/asap_types/src/aggregation_config.rs index d7b49a84..a6c68dcc 100644 --- a/crates/asap_types/src/aggregation_config.rs +++ b/crates/asap_types/src/aggregation_config.rs @@ -7,8 +7,8 @@ use crate::enums::{QueryLanguage, WindowType}; use crate::policy_fingerprint::PolicyFingerprint; use crate::traits::SerializableToSink; use crate::utils::normalize_spatial_filter; +use crate::AggregationType; use crate::KeyByLabelNames; -use promql_utilities::query_logics::enums::AggregationType; /// Per-aggregation policy carried in the streaming config. /// diff --git a/crates/promql_utilities/src/query_logics/enums.rs b/crates/asap_types/src/aggregation_type.rs similarity index 84% rename from crates/promql_utilities/src/query_logics/enums.rs rename to crates/asap_types/src/aggregation_type.rs index 2332341b..d9831547 100644 --- a/crates/promql_utilities/src/query_logics/enums.rs +++ b/crates/asap_types/src/aggregation_type.rs @@ -1,3 +1,23 @@ +//! Formerly `promql_utilities::query_logics::enums::AggregationType` — moved +//! here as the final step of retiring the `promql_utilities` crate (see +//! `scratchpad/artifacts/retirement-plan.html` / the earlier Stage 1-3 work +//! that already moved `Statistic`/`KeyByLabelNames`/`QueryResultType` out of +//! it for the same reason). By the time this moved, `promql_utilities` held +//! nothing but this one type — `asap_types` is its real center of gravity +//! (`compatible_agg_types`, `AggregationConfig`, `PolicyFingerprint`, +//! `capability_matching`), and is the shared foundation both +//! `control_plane`'s ecosystem and `data_plane` can depend on without a +//! cycle, so there was no longer a reason for a separate crate. +//! +//! Note: this is representation **D** in +//! `scratchpad/artifacts/enum-unification-plan.md` — the data-plane's own +//! `AggregationType` + `String` sub-type + untyped params bag, conflating +//! sketch/accumulator identity with a keyed/unkeyed axis. Step 5 of that +//! plan introduced `AccumulatorSpec` as a typed, unconflated replacement +//! (additive so far, not yet fully replacing this type) — this move is +//! purely about which crate `AggregationType` lives in, not a change to +//! its shape or semantics. + use serde::{Deserialize, Serialize}; use std::fmt; use std::str::FromStr; diff --git a/crates/asap_types/src/capability_matching.rs b/crates/asap_types/src/capability_matching.rs index 871e40f6..ad2d75f3 100644 --- a/crates/asap_types/src/capability_matching.rs +++ b/crates/asap_types/src/capability_matching.rs @@ -10,7 +10,7 @@ use crate::aggregation_config::{AggregationConfig, AggregationIdInfo}; use crate::enums::WindowType; use crate::query_requirements::QueryRequirements; use crate::utils::normalize_spatial_filter; -use promql_utilities::query_logics::enums::AggregationType; +use crate::AggregationType; pub const ENGINE_ID_ASAP_QUERY: &str = "asap_query"; pub const ENGINE_ID_THANOS_QUERY: &str = "thanos_query"; diff --git a/crates/asap_types/src/enums.rs b/crates/asap_types/src/enums.rs index fcf68e49..e50bf57e 100644 --- a/crates/asap_types/src/enums.rs +++ b/crates/asap_types/src/enums.rs @@ -2,9 +2,6 @@ use std::fmt; use std::str::FromStr; use tracing::debug; -// Re-export AggregationType from promql_utilities (defined there to avoid circular deps). -pub use promql_utilities::query_logics::enums::AggregationType; - /// The scalar value a serving-time query wants out of an already-built /// accumulator: "given a live `AggregateCore` implementation, which /// number do you want?" Every accumulator's `AggregateCore::query_statistic` diff --git a/crates/asap_types/src/lib.rs b/crates/asap_types/src/lib.rs index 269f0e6d..83d0c175 100644 --- a/crates/asap_types/src/lib.rs +++ b/crates/asap_types/src/lib.rs @@ -1,4 +1,5 @@ pub mod aggregation_config; +pub mod aggregation_type; pub mod capability_matching; pub mod enums; pub mod key_by_label_names; @@ -10,6 +11,7 @@ pub mod traits; pub mod utils; pub use aggregation_config::*; +pub use aggregation_type::AggregationType; pub use capability_matching::{ compatible_storage_backends, find_compatible_aggregation, parse_storage_backend_engine_id, AccuracyTarget, StorageBackend, CANONICAL_QUERY_ENGINE_IDS, ENGINE_ID_ASAP_QUERY, diff --git a/crates/asap_types/src/policy_fingerprint.rs b/crates/asap_types/src/policy_fingerprint.rs index 9b365308..7a5c285f 100644 --- a/crates/asap_types/src/policy_fingerprint.rs +++ b/crates/asap_types/src/policy_fingerprint.rs @@ -173,8 +173,8 @@ impl std::fmt::Display for PolicyFingerprint { mod tests { use super::*; use crate::enums::WindowType; + use crate::AggregationType; use crate::KeyByLabelNames; - use promql_utilities::query_logics::enums::AggregationType; use std::collections::HashMap; fn cfg( diff --git a/crates/asap_types/src/policy_registry.rs b/crates/asap_types/src/policy_registry.rs index 0bf7ed0b..99cd399d 100644 --- a/crates/asap_types/src/policy_registry.rs +++ b/crates/asap_types/src/policy_registry.rs @@ -116,8 +116,8 @@ impl PolicyRegistry { mod tests { use super::*; use crate::enums::WindowType; + use crate::AggregationType; use crate::KeyByLabelNames; - use promql_utilities::query_logics::enums::AggregationType; use std::collections::HashMap as StdHashMap; fn cfg(_id: u64, metric: &str) -> AggregationConfig { diff --git a/crates/promql_utilities/.gitignore b/crates/promql_utilities/.gitignore deleted file mode 100644 index 9f970225..00000000 --- a/crates/promql_utilities/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target/ \ No newline at end of file diff --git a/crates/promql_utilities/Cargo.toml b/crates/promql_utilities/Cargo.toml deleted file mode 100644 index 08041222..00000000 --- a/crates/promql_utilities/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "promql_utilities" -version.workspace = true -edition.workspace = true -authors = ["SketchDB Team"] -description = "A standalone PromQL pattern matching and query analysis library for Rust" -license = "MIT" -keywords = ["prometheus", "promql", "pattern-matching", "query-analysis"] -categories = ["parsing", "database", "development-tools"] - -[dependencies] -promql-parser.workspace = true -serde.workspace = true -serde_json.workspace = true -thiserror.workspace = true -chrono.workspace = true -tracing.workspace = true - -[dev-dependencies] -tokio-test = "0.4" diff --git a/crates/promql_utilities/src/lib.rs b/crates/promql_utilities/src/lib.rs deleted file mode 100644 index b6d257db..00000000 --- a/crates/promql_utilities/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod query_logics; - -pub use query_logics::*; diff --git a/crates/promql_utilities/src/query_logics/mod.rs b/crates/promql_utilities/src/query_logics/mod.rs deleted file mode 100644 index 7071c4c3..00000000 --- a/crates/promql_utilities/src/query_logics/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod enums; - -pub use enums::*; diff --git a/data_plane/Cargo.toml b/data_plane/Cargo.toml index 142397f2..985ea52f 100644 --- a/data_plane/Cargo.toml +++ b/data_plane/Cargo.toml @@ -5,7 +5,6 @@ edition.workspace = true [dependencies] # Internal crates (workspace) -promql_utilities.workspace = true asap_types.workspace = true # Phase 9: the control plane is now an in-process library inside the # backend binary. Wiring up the in-process OpAMP server + capability-map diff --git a/data_plane/benches/sketch_db.rs b/data_plane/benches/sketch_db.rs index 5ac0c041..1ef08fcd 100644 --- a/data_plane/benches/sketch_db.rs +++ b/data_plane/benches/sketch_db.rs @@ -388,7 +388,8 @@ fn bench_query_precomputes_by_agg(c: &mut Criterion) { /// case, where the per-batch reconcile is pure scan overhead. fn matching_streaming_config(metric: &str) -> data_plane::storage_engines::types::StreamingConfig { use asap_types::aggregation_config::AggregationConfig; - use asap_types::enums::{AggregationType as AT, WindowType}; + use asap_types::enums::WindowType; + use asap_types::AggregationType as AT; use asap_types::KeyByLabelNames; use std::collections::HashMap; diff --git a/data_plane/src/drivers/ingest/otel.rs b/data_plane/src/drivers/ingest/otel.rs index 77b89828..aca607c4 100644 --- a/data_plane/src/drivers/ingest/otel.rs +++ b/data_plane/src/drivers/ingest/otel.rs @@ -1726,9 +1726,9 @@ async fn route_modified_otlp_sketches_to_precompute( /// fails the (rare) defensive path explicitly. fn aggregation_type_for_sketch_handle( handle: crate::storage_engines::sketch_db::index::SketchKindHandle, -) -> Option { +) -> Option { use crate::storage_engines::sketch_db::index::SketchKindHandle; - use promql_utilities::query_logics::enums::AggregationType; + use asap_types::AggregationType; match handle { SketchKindHandle::DDSketch => Some(AggregationType::DDSketch), SketchKindHandle::Kll => Some(AggregationType::DatasketchesKLL), @@ -2898,7 +2898,7 @@ mod policy_fp_lookup_tests { use super::*; use crate::storage_engines::sketch_db::data::SketchConfig; use crate::storage_engines::sketch_db::index::SketchKindHandle; - use promql_utilities::query_logics::enums::AggregationType; + use asap_types::AggregationType; #[test] fn handle_to_agg_type_round_trips_canonical_kinds() { @@ -4003,7 +4003,8 @@ mod sid_bucketing_tests { Metric as PbMetric, NumberDataPoint, ResourceMetrics, ScopeMetrics, }; use asap_types::aggregation_config::AggregationConfig; - use asap_types::enums::{AggregationType, WindowType}; + use asap_types::enums::WindowType; + use asap_types::AggregationType; use asap_types::KeyByLabelNames; use std::collections::HashMap; use std::sync::Arc; diff --git a/data_plane/src/drivers/query/servers/http.rs b/data_plane/src/drivers/query/servers/http.rs index 8a81b034..13595ae2 100644 --- a/data_plane/src/drivers/query/servers/http.rs +++ b/data_plane/src/drivers/query/servers/http.rs @@ -2469,7 +2469,7 @@ aggregations: group_by_keys, capability: None, agg_kind: AggKind::ExactAgg { - agg_type: asap_types::enums::AggregationType::Sum, + agg_type: asap_types::AggregationType::Sum, parameters_canonical: String::new(), spatial_filter_canonical: String::new(), }, @@ -3044,7 +3044,8 @@ aggregations: active_agg_ids: &[u64], ) -> (u16, std::collections::HashMap) { use asap_types::aggregation_config::AggregationConfig; - use asap_types::enums::{AggregationType, WindowType}; + use asap_types::enums::WindowType; + use asap_types::AggregationType; use asap_types::KeyByLabelNames; use std::collections::HashMap; diff --git a/data_plane/src/precompute_engine/accumulator_factory.rs b/data_plane/src/precompute_engine/accumulator_factory.rs index 2ddbf538..0766a4a9 100644 --- a/data_plane/src/precompute_engine/accumulator_factory.rs +++ b/data_plane/src/precompute_engine/accumulator_factory.rs @@ -948,7 +948,8 @@ pub fn create_accumulator_updater(config: &AggregationConfig) -> Box AggregationConfig { diff --git a/data_plane/src/precompute_engine/worker.rs b/data_plane/src/precompute_engine/worker.rs index f39d1ff7..0da63da0 100644 --- a/data_plane/src/precompute_engine/worker.rs +++ b/data_plane/src/precompute_engine/worker.rs @@ -1370,7 +1370,8 @@ mod tests { use crate::precompute_engine::output_sink::CapturingOutputSink; use crate::storage_engines::types::StreamingConfig; use asap_sketchlib::KllSketch; - use asap_types::enums::{AggregationType, WindowType}; + use asap_types::enums::WindowType; + use asap_types::AggregationType; fn make_agg_config( id: u64, diff --git a/data_plane/src/storage_engines/sketch_db/accuracy.rs b/data_plane/src/storage_engines/sketch_db/accuracy.rs index 646670a0..c64db38d 100644 --- a/data_plane/src/storage_engines/sketch_db/accuracy.rs +++ b/data_plane/src/storage_engines/sketch_db/accuracy.rs @@ -45,7 +45,7 @@ use serde::{Deserialize, Serialize}; use asap_types::aggregation_config::AggregationConfig; -use promql_utilities::query_logics::enums::AggregationType; +use asap_types::AggregationType; /// How to interpret [`AccuracyProfile::epsilon`]. /// diff --git a/data_plane/src/storage_engines/sketch_db/backfill/processor.rs b/data_plane/src/storage_engines/sketch_db/backfill/processor.rs index e417068a..00059b13 100644 --- a/data_plane/src/storage_engines/sketch_db/backfill/processor.rs +++ b/data_plane/src/storage_engines/sketch_db/backfill/processor.rs @@ -403,7 +403,8 @@ mod tests { use crate::storage_engines::sketch_db::backfill::worker::BackfillWorker; use crate::storage_engines::sketch_db::backfill::BackfillSource; use crate::storage_engines::types::StreamingConfig; - use asap_types::enums::{AggregationType, WindowType}; + use asap_types::enums::WindowType; + use asap_types::AggregationType; use asap_types::KeyByLabelNames; use std::sync::Arc; diff --git a/data_plane/src/storage_engines/sketch_db/backfill/service.rs b/data_plane/src/storage_engines/sketch_db/backfill/service.rs index 1e896a1f..d6057347 100644 --- a/data_plane/src/storage_engines/sketch_db/backfill/service.rs +++ b/data_plane/src/storage_engines/sketch_db/backfill/service.rs @@ -329,7 +329,8 @@ mod tests { }; use crate::storage_engines::types::StreamingConfig; use asap_types::aggregation_config::AggregationConfig; - use asap_types::enums::{AggregationType, WindowType}; + use asap_types::enums::WindowType; + use asap_types::AggregationType; use asap_types::KeyByLabelNames; use std::sync::Mutex; diff --git a/data_plane/src/storage_engines/sketch_db/backfill/window_builder.rs b/data_plane/src/storage_engines/sketch_db/backfill/window_builder.rs index 9a47b784..bae84685 100644 --- a/data_plane/src/storage_engines/sketch_db/backfill/window_builder.rs +++ b/data_plane/src/storage_engines/sketch_db/backfill/window_builder.rs @@ -118,7 +118,8 @@ pub fn build_backfilled_accumulator( mod tests { use super::*; use asap_types::aggregation_config::AggregationConfig; - use asap_types::enums::{AggregationType, WindowType}; + use asap_types::enums::WindowType; + use asap_types::AggregationType; use asap_types::KeyByLabelNames; use std::collections::HashMap; diff --git a/data_plane/src/storage_engines/sketch_db/data/mod.rs b/data_plane/src/storage_engines/sketch_db/data/mod.rs index 89bdb8ff..c35f1574 100644 --- a/data_plane/src/storage_engines/sketch_db/data/mod.rs +++ b/data_plane/src/storage_engines/sketch_db/data/mod.rs @@ -60,7 +60,7 @@ pub use control_plane::sketch_algebra::{Capability, SketchKindHandle}; /// Re-export so callers don't need to depend on promql_utilities /// directly for the agg_type tag. -pub use promql_utilities::query_logics::enums::AggregationType; +pub use asap_types::AggregationType; // ── Payload taxonomy ──────────────────────────────────────────────────────── diff --git a/data_plane/src/storage_engines/sketch_db/lifecycle/reconcile.rs b/data_plane/src/storage_engines/sketch_db/lifecycle/reconcile.rs index 5f59a26e..8f710813 100644 --- a/data_plane/src/storage_engines/sketch_db/lifecycle/reconcile.rs +++ b/data_plane/src/storage_engines/sketch_db/lifecycle/reconcile.rs @@ -276,7 +276,8 @@ mod tests { use std::collections::HashMap; use asap_types::aggregation_config::AggregationConfig; - use asap_types::enums::{AggregationType, WindowType}; + use asap_types::enums::WindowType; + use asap_types::AggregationType; use asap_types::KeyByLabelNames; use crate::storage_engines::sketch_db::data::AggKind; diff --git a/data_plane/src/storage_engines/types/enums.rs b/data_plane/src/storage_engines/types/enums.rs index 224e2a55..73e10d52 100644 --- a/data_plane/src/storage_engines/types/enums.rs +++ b/data_plane/src/storage_engines/types/enums.rs @@ -1,5 +1,5 @@ pub use asap_types::enums::{CleanupPolicy, QueryLanguage, WindowType}; -pub use promql_utilities::query_logics::enums::AggregationType; +pub use asap_types::AggregationType; #[derive(clap::ValueEnum, Clone, Debug, PartialEq)] pub enum QueryProtocol { diff --git a/data_plane/src/storage_engines/types/hot_reload_config.rs b/data_plane/src/storage_engines/types/hot_reload_config.rs index eddb3eaa..da182b74 100644 --- a/data_plane/src/storage_engines/types/hot_reload_config.rs +++ b/data_plane/src/storage_engines/types/hot_reload_config.rs @@ -138,7 +138,8 @@ impl std::fmt::Debug for HotReloadStreamingConfig { mod tests { use super::*; use crate::storage_engines::types::AggregationConfig; - use asap_types::enums::{AggregationType, WindowType}; + use asap_types::enums::WindowType; + use asap_types::AggregationType; use asap_types::KeyByLabelNames; use std::collections::HashMap; use std::thread; diff --git a/data_plane/src/storage_engines/types/traits.rs b/data_plane/src/storage_engines/types/traits.rs index 5d78eb44..00a26f00 100644 --- a/data_plane/src/storage_engines/types/traits.rs +++ b/data_plane/src/storage_engines/types/traits.rs @@ -2,8 +2,8 @@ use crate::storage_engines::types::KeyByLabelValues; use serde_json::Value; use std::collections::HashMap; +use asap_types::AggregationType; use asap_types::Statistic; -use promql_utilities::query_logics::enums::AggregationType; pub use asap_types::traits::SerializableToSink; diff --git a/data_plane/src/tests/accuracy_empirical_validation_tests.rs b/data_plane/src/tests/accuracy_empirical_validation_tests.rs index ef5add07..291f6e82 100644 --- a/data_plane/src/tests/accuracy_empirical_validation_tests.rs +++ b/data_plane/src/tests/accuracy_empirical_validation_tests.rs @@ -29,8 +29,8 @@ use std::collections::HashMap; use asap_types::aggregation_config::AggregationConfig; use asap_types::enums::WindowType; +use asap_types::AggregationType; use asap_types::KeyByLabelNames; -use promql_utilities::query_logics::enums::AggregationType; use serde_json::{json, Value}; use crate::storage_engines::sketch_db::accuracy::{AccuracyKind, AccuracyProfile}; diff --git a/data_plane/tests/e2e_modified_otlp_sketch_path.rs b/data_plane/tests/e2e_modified_otlp_sketch_path.rs index 7f41bbfc..25089f2b 100644 --- a/data_plane/tests/e2e_modified_otlp_sketch_path.rs +++ b/data_plane/tests/e2e_modified_otlp_sketch_path.rs @@ -38,7 +38,8 @@ use asap_sketchlib::proto::sketchlib::{ }; use asap_sketchlib::MessagePackCodec; use asap_types::aggregation_config::AggregationConfig; -use asap_types::enums::{AggregationType, WindowType}; +use asap_types::enums::WindowType; +use asap_types::AggregationType; use prost::Message; use std::collections::HashMap; use std::sync::Arc;