Skip to content

Feature/product datastore#643

Open
F1r3w477 wants to merge 5 commits into
dpaulat:developfrom
F1r3w477:feature/product-datastore
Open

Feature/product datastore#643
F1r3w477 wants to merge 5 commits into
dpaulat:developfrom
F1r3w477:feature/product-datastore

Conversation

@F1r3w477

@F1r3w477 F1r3w477 commented May 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Slice B of the multi-provider refactor (#506): extract ProductDatastore from RadarProductManager.

Record storage, cache/LRU eviction, product-time population, and cache lookup now live in a dedicated class. RadarProductManager keeps orchestration — providers, refresh, coordinate generation, and the L2/L3 load paths — and delegates storage to productDatastore_.

Stacked on #642 (feature/extract-provider-manager / Slice A).

What moved

  • New: ProductDatastore — L2/L3 record maps, recent-record LRU, Store, GetCachedNexradFile, FindLevel2RecordEntries / FindLevel3RecordEntry, PopulateLevel2/3ProductTimes, AreProductTimesPopulated
  • Removed from RPM: ~425 lines of inline map/mutex/cache logic (StoreRadarProductRecord, UpdateRecentRecords, local typedefs)
  • Hardening:
    • Null guards on provider_ before provider calls
    • GetCachedNexradFile keys aligned to seconds (matches Store)
    • Atomic cacheLimit_ for concurrent SetCacheLimit
    • AreLevel2ProductTimesPopulated checks archive and chunks providers

Test plan

  • ProductDatastore.* unit tests (7) — dedup, find, cache lookup, sub-second cache key, cache limit floor
  • Existing RadarProductManager / ProviderManager tests pass
  • Manual: live L2 + L3, archive timeline loop, site switch, clean quit
  • Make sure CI passes

Notes

  • No user-facing behavior change intended — mechanical extract + small hardening

Move record maps, cache/LRU, populate-times, and lookup into
ProductDatastore. Harden null-provider guards, second-aligned cache
lookup, atomic cache limit, and L2 chunks time-populated check.

Refs dpaulat#506

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread scwx-qt/source/scwx/qt/manager/product_datastore.cpp Outdated
Comment thread scwx-qt/source/scwx/qt/manager/product_datastore.cpp Outdated
Comment thread scwx-qt/source/scwx/qt/manager/product_datastore.cpp Outdated
Comment thread scwx-qt/source/scwx/qt/manager/product_datastore.cpp Outdated
Comment thread scwx-qt/source/scwx/qt/manager/product_datastore.cpp Outdated
Comment thread scwx-qt/source/scwx/qt/manager/provider_manager.hpp
Comment thread scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp Outdated
Comment thread test/source/scwx/qt/manager/radar_product_manager.test.cpp Outdated
Comment thread test/source/scwx/qt/manager/radar_product_manager.test.cpp Outdated
Comment thread test/source/scwx/qt/manager/radar_product_manager.test.cpp Outdated
Const-correct locks, deleted ProviderManager moves, explicit lambda
captures, named cache limit constant, and const ref Store params.
@dpaulat dpaulat requested a review from Copilot May 24, 2026 03:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Extracts product record storage/cache responsibilities from RadarProductManager into a dedicated ProductDatastore as part of the multi-provider refactor (Slice B), and moves the internal ProviderManager into its own compilation unit.

Changes:

  • Added ProductDatastore for record storage, cache/LRU behavior, and product-time population/lookup.
  • Extracted ProviderManager from radar_product_manager.cpp into standalone provider_manager.{hpp,cpp}.
  • Updated RadarProductManager to delegate storage and cache lookups to productDatastore_ and added/updated unit tests and build wiring.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/test.cmake Registers new ProductDatastore unit tests in the test build.
test/source/scwx/qt/manager/radar_product_manager.test.cpp Adds ProviderManager::name() formatting test and adjusts includes.
test/source/scwx/qt/manager/product_datastore.test.cpp New unit tests for datastore dedup, lookup, cache key behavior, and cache limit floor.
scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp Delegates storage/cache/time-population to ProductDatastore and uses extracted ProviderManager.
scwx-qt/source/scwx/qt/manager/provider_manager.hpp New standalone ProviderManager header.
scwx-qt/source/scwx/qt/manager/provider_manager.cpp New standalone ProviderManager implementation (refresh scheduling, shutdown hardening).
scwx-qt/source/scwx/qt/manager/product_datastore.hpp New datastore public API for caching/record maps/LRU and time population.
scwx-qt/source/scwx/qt/manager/product_datastore.cpp Implements record storage/dedup, cache lookups, time population, and iteration helpers.
scwx-qt/scwx-qt.cmake Adds new manager source/header files to the Qt build.

Comment thread scwx-qt/source/scwx/qt/manager/product_datastore.cpp Outdated
Comment thread scwx-qt/source/scwx/qt/manager/product_datastore.cpp
Comment thread scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp
Comment thread scwx-qt/source/scwx/qt/manager/radar_product_manager.cpp
Comment thread scwx-qt/source/scwx/qt/manager/product_datastore.cpp Outdated
Comment thread scwx-qt/source/scwx/qt/manager/provider_manager.cpp
F1r3w477 added 3 commits May 28, 2026 20:01
Avoid relying on transitive includes for std::max/std::find.
Align dpaulat#643 with review standards from dpaulat#642/dpaulat#644: hide implementation
details behind Impl, use ProviderManager accessors, fix RPM include
order, and add QT_NO_EMIT for wxtest on Linux.
Keep ProductDatastore delegation in RPM; integrate RadarCoordinateTable
and merged ProviderManager from develop. Drop duplicate cache/populate
logic left in develop's RPM.
@F1r3w477 F1r3w477 marked this pull request as ready for review June 24, 2026 20:38
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.

2 participants