-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#6561] improvement(core): Cache Hadoop Filesystem instance on Gravitino server to improve the performance #6619
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,23 @@ public interface FileSystemProvider { | |
FileSystem getFileSystem(@Nonnull Path path, @Nonnull Map<String, String> config) | ||
throws IOException; | ||
|
||
/** | ||
* Get the FileSystem instance according to the configuration map and file path. | ||
* | ||
* @param config The configuration for the FileSystem instance. | ||
* @param path The path to the file system. | ||
* @param disableCache Whether to cache the FileSystem instance. | ||
* @return The FileSystem instance. | ||
* @throws IOException If the FileSystem instance cannot be created. | ||
*/ | ||
default FileSystem getFileSystem( | ||
@Nonnull Path path, @Nonnull Map<String, String> config, boolean disableCache) | ||
throws IOException { | ||
// disable cache | ||
config.put(String.format("fs.%s.impl.disable.cache", scheme()), String.valueOf(disableCache)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if the config already contains key There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will overwrite. I think we should prioritize the disableCache parameter. |
||
return getFileSystem(path, config); | ||
} | ||
|
||
/** | ||
* Scheme of this FileSystem provider. The value is 'file' for LocalFileSystem, 'hdfs' for HDFS, | ||
* etc. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this method only be used by the Gravitino server?