[#11813] fix(gvfs): override getScheme() to return 'gvfs'#11814
Merged
Conversation
FileSystem#getScheme() throws UnsupportedOperationException by default, which breaks Hadoop/Spark commit protocols (e.g. FileOutputCommitter, ManifestCommitter) when writing to a gvfs:// path. Override getScheme() in GravitinoVirtualFileSystem to return the GVFS scheme constant. Added unit test testGetScheme in TestGvfsBase.
yuqi1129
approved these changes
Jun 28, 2026
Code Coverage Report
Files
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
FileSystem#getScheme() throws UnsupportedOperationException by default, which breaks Hadoop/Spark commit protocols (e.g. FileOutputCommitter, ManifestCommitter) when writing to a gvfs:// path. Override getScheme() in GravitinoVirtualFileSystem to return the GVFS scheme constant. Added unit test testGetScheme in TestGvfsBase.
What changes were proposed in this pull request?
Override
getScheme()inGravitinoVirtualFileSystemto return the GVFS scheme constant (gvfs), instead of relying on the defaultorg.apache.hadoop.fs.FileSystem#getScheme()which throwsUnsupportedOperationException.Why are the changes needed?
Hadoop's default
FileSystem#getScheme()throwsUnsupportedOperationExceptionif a subclass doesn't override it. Hadoop / Spark commit protocols callgetScheme()during job setup / commit, so writing to agvfs://path currently fails. Returning the well-knowngvfsscheme — which is already the URI scheme GVFS advertises and the value ofGravitinoVirtualFileSystemConfiguration.GVFS_SCHEME— makes GVFS behave like every other HadoopFileSystemimplementation (LocalFS →file, HDFS →hdfs, S3A →s3a, …).Fix: #11813
Does this PR introduce any user-facing change?
No public API change.
FileSystem#getScheme()on aGravitinoVirtualFileSysteminstance now returns"gvfs"instead of throwing. No new / removed configuration keys.How was this patch tested?
Added a new unit test
TestGvfsBase#testGetSchemethat assertsfs.getScheme()equalsGravitinoVirtualFileSystemConfiguration.GVFS_SCHEME. Ran./gradlew :clients:filesystem-hadoop3:testlocally and all tests pass.