Skip to content

Feat/hadoop version hint#964

Merged
laskoviymishka merged 2 commits into
apache:mainfrom
tanmayrauth:feat/hadoop-version-hint
May 1, 2026
Merged

Feat/hadoop version hint#964
laskoviymishka merged 2 commits into
apache:mainfrom
tanmayrauth:feat/hadoop-version-hint

Conversation

@tanmayrauth
Copy link
Copy Markdown
Contributor

2: Version-hint management
Implement readVersionHint (reads the integer from version-hint.text, returns 0 on any error), writeVersionHint (writes to a temp file then renames, best-effort with errors logged but not returned), and findVersion with the full three-tier fallback: read hint and validate the file exists, scan forward from the hinted version until no file is found, and if there's no hint at all, list the metadata directory to find the max version then scan forward. Tests cover round-trip read/write, missing hint, corrupt hint, stale hint (v3 exists but hint says 2), scan-forward behavior, directory listing fallback, and the no-metadata-files case.

Relates to #798

Implement readVersionHint, writeVersionHint, scanForward, and
findVersion with three-tier fallback: read hint and validate,
scan forward, fall back to directory listing.

Relates to apache#798

Depends-on: apache#953 (scaffold)
Depended-on-by: PR 4 (table CRUD)
…alidation

scanForward and findVersion hint validation only checked for
v{N}.metadata.json, missing gzip-compressed v{N}.gz.metadata.json
files. This could return a stale version when metadata compression
was enabled. Extract metadataVersionExists helper that checks both
formats.
@tanmayrauth tanmayrauth requested a review from zeroshade as a code owner April 30, 2026 21:29
Copy link
Copy Markdown
Contributor

@laskoviymishka laskoviymishka left a comment

Choose a reason for hiding this comment

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

@tanmayrauth let's rename PR to make it consistent, commit name sound right to me:

feat(catalog): add version-hint management for Hadoop catalog

Once renamed - good to merge

@laskoviymishka laskoviymishka merged commit f026751 into apache:main May 1, 2026
14 checks passed
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