You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HBASE-30600 Preserve legacy open behavior for hbase.fs.wrapper when using FileSystem.openFile - #8953
The reason will be displayed to describe this comment to others. Learn more.
Claude has some non-blocking comments, but overall the change looks good:
The check is too cautious. It goes back to the slower open for any custom wrapper that doesn't support the new method, even wrappers that never hooked open() in the first place (for example, one that only adds metrics on writes). Those wrappers lose the speedup for no reason. A sharper check would fall back only when the wrapper actually customizes open().
It repeats the same lookup on every file open. The check inspects the wrapper's class using reflection every time a file is opened. The answer never changes for a given class, so it could be worked out once and cached (for example with ClassValue). This is cheap and keeps the code clean.
There's no log message. When HBase falls back to the slower open, nothing is logged. A one-time message like "your wrapper doesn't support the faster open, using the old one" would help operators see why they aren't getting the speedup.
One error branch can never run. NoSuchMethodException can't happen on the Hadoop versions HBase supports. It's harmless, but a short comment saying so would help readers.
The tests miss the real-world setup.
The test builds the wrapper by hand. It never sets hbase.fs.wrapper in the config, which is how real users enable it. A test that goes through the config would cover the actual code path.
No test checks the opposite case: a wrapper that does support the new method should still get the fast open.
Docs and backports. Update the openForRead Javadoc to describe the fallback, and make sure the fix lands on every branch the original change went to (master and branch-3).
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The fast-path check still bypasses stream decoration when a transparent FilterFileSystem wraps a legacy-open-only wrapper, requiring inspection of nested delegating layers and a regression test.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The compatibility check still allows builder opens to bypass wrapper stream decoration for legacy open overrides, affecting reads such as no-checksum HFile reads.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Builder opens bypass stream decoration for legacy open overrides
The compatibility check still allows builder opens to bypass stream decoration when a wrapper overrides only open(Path), or when a subclass adds a legacy override below an inherited, delegating openFile(Path) override. This affects direct wrapper reads such as no-checksum HFile reads; Hadoop's default-branch implementation delegates builder opens to the backing filesystem. Check both legacy overloads and require the builder override to be declared at least as far down the hierarchy as either legacy override, with regression tests for both cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
it's mainly from this review comment #8935 (comment) such that we need to make sure the FileSystem.openFile is being used correctly with HFileSystem.