Skip to content

fdb-adopt to re-index an existing grib file - #305

Open
danovaro wants to merge 1 commit into
developfrom
feature/adopt
Open

fdb-adopt to re-index an existing grib file#305
danovaro wants to merge 1 commit into
developfrom
feature/adopt

Conversation

@danovaro

@danovaro danovaro commented Jul 23, 2026

Copy link
Copy Markdown
Member

Description

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌈🌦️📖🚧 Documentation FDB 🚧📖🌦️🌈
https://sites.ecmwf.int/docs/fdb/pull-requests/PR-305

@codecov-commenter

codecov-commenter commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 4.54545% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.36%. Comparing base (09312de) to head (bb47595).

Files with missing lines Patch % Lines
src/fdb5/tools/fdb-adopt.cc 0.00% 42 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #305      +/-   ##
===========================================
- Coverage    77.36%   77.36%   -0.01%     
===========================================
  Files          410      411       +1     
  Lines        27483    27525      +42     
  Branches      2758     2763       +5     
===========================================
+ Hits         21263    21295      +32     
- Misses        6220     6230      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Adds a new fdb-adopt CLI tool to (re)index fields from an existing GRIB file into an FDB catalogue, and wires it into the tools build. Also includes a small refactor in Archiver::flush().

Changes:

  • Added src/fdb5/tools/fdb-adopt.cc to scan GRIB files, decode keys, and create reindex() entries pointing at file offsets.
  • Registered the new tool in src/fdb5/CMakeLists.txt so it is built/installed with other FDB tools.
  • Refactored Archiver::flush() loop to a range-based form.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/fdb5/tools/fdb-adopt.cc New CLI tool that scans GRIB input and writes reindex entries using TocFieldLocation offsets
src/fdb5/database/Archiver.cc Minor loop refactor in flush()
src/fdb5/CMakeLists.txt Adds fdb-adopt to the fdb5_tools executable list

Comment thread src/fdb5/tools/fdb-adopt.cc
Comment thread src/fdb5/database/Archiver.cc Outdated
Comment thread src/fdb5/tools/fdb-adopt.cc Outdated
eckit::Length length = msg.length();
eckit::Offset offset = reader.position() - length;

fdb.reindex(key, fdb5::TocFieldLocation{uri, offset, length, fdb5::Key()});
@danovaro
danovaro force-pushed the feature/adopt branch 2 times, most recently from 8b3d4f6 to 36e307d Compare August 11, 2026 21:50
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.

3 participants