Skip to content

refactor(http): drop Arc<dyn Store> from HttpServer + runtime-info adapter - #169

Merged
zzylol merged 1 commit into
mainfrom
feat/http-drop-store
May 13, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/http-drop-store

Conversation

@zzylol

@zzylol zzylol commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 5 M2.3.6g step 3 — HttpServer and the protocol-adapter trait's handle_runtime_info family switch from Arc<dyn Store> to Arc<SketchIndex>. The Prometheus adapter's earliest-timestamp field is renamed from earliest_timestamp_per_aggregation_id to earliest_timestamp_per_sid (wire-format change; data shape otherwise identical: u64 → u64 map).

Implementation

  • New SketchIndex::earliest_timestamps_per_sid() -> HashMap<u64, u64> returns each sid's first_seen_unix_ms from instance metadata.
  • Replaces Store::get_earliest_timestamp_per_aggregation_id at:
    • Prometheus adapter's handle_runtime_info (/api/v1/status/runtimeinfo)
    • HTTP server's /api/v1/store/metrics endpoint

Test fixtures that constructed an HttpServer with a SketchStore now bind it to _store and pass a fresh empty SketchIndex — they don't exercise the runtime-info path.

Test plan

  • cargo test -p data_plane --lib — 811/811 pass.
  • cargo check --workspace clean.

🤖 Generated with Claude Code

…apter

Phase 5 M2.3.6g step 3 — `HttpServer` and the protocol-adapter trait's
`handle_runtime_info` family switch from `Arc<dyn Store>` to
`Arc<SketchIndex>`. The Prometheus adapter's earliest-timestamp
field is renamed from `earliest_timestamp_per_aggregation_id` to
`earliest_timestamp_per_sid` (wire-format change; the data shape is
otherwise identical: u64 → u64 map).

Adds `SketchIndex::earliest_timestamps_per_sid() -> HashMap<u64, u64>`
that returns each sid's `first_seen_unix_ms` from instance metadata.
Replaces the legacy `Store::get_earliest_timestamp_per_aggregation_id`
call sites (HTTP runtime-info endpoint, `/api/v1/store/metrics`).

Test fixtures that constructed an HttpServer with a `SketchStore`
now bind it to `_store` and pass a fresh empty `SketchIndex` to the
constructor — they don't exercise the runtime-info path so the
empty index is fine.

811/811 lib tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 51123eb into main May 13, 2026
@zzylol
zzylol deleted the feat/http-drop-store branch July 17, 2026 20:05
zzylol added a commit that referenced this pull request Jul 29, 2026
…-time (#425)

Written independent of what's currently implemented, grounded entirely
in ASAPController's own current interfaces -- specifically the
`## Interface` sections added to docs/l1-query-language.md through
l5-physical-plan.md in ASAPController#169 (every signature there
verified against ASAPController main at cc18c98, 2026-07-28).

Core claim: control_plane should be a thin planning-time shell around
asap-ir/asap-l2/asap-plan/asap-sketch, contributing exactly two things
ASAPController doesn't ship -- an L5 physical planner (ASAPController
has no asap-physical crate; L5 is explicitly speculative there, real
here) and deployment-specific L4 extension points (CostModel, Matcher).
data_plane should be a thin serving-time shell implementing
SummaryExecutor once.

The gap table (S4) finds L2-L4 substantially already at this target
(thin re-export shims, ControlPlaneCostModel, SummaryFamilyMatcher) --
the two genuinely open items are L1 (adopt asap-frontend-promql,
retiring query_parser/ outright) and the serving-time cutover
(SummaryExecutor is fully implemented but not yet the live path).
L5 should NOT shrink -- it's this deployment's own permanent
contribution, not legacy debt, precisely because no asap-physical
crate exists upstream.

S5 reconciles this with data_plane/docs/l4node-plan-executor-design.md
(PR #409)'s open questions -- PR #169's Reduction::{Reduce(GroupKeys),
PerEntity} type looks like it resolves the grouping-ambiguity question
that doc flagged as blocking, via a real upstream IR signal rather than
a per-deployment heuristic.

Supersedes #409 with a version grounded in ASAPController's now-merged
official interface docs rather than proposing/guessing at them.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant