-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-18129: Change URI to String in INodeLink to reduce memory footprint of ViewFileSystem #3996
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
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 |
|---|---|---|
|
|
@@ -216,19 +216,27 @@ public static class MountPoint { | |
| /** | ||
| * Array of target FileSystem URIs. | ||
| */ | ||
| private final URI[] targetFileSystemURIs; | ||
| private final String[] targetFileSystemPaths; | ||
|
|
||
| MountPoint(Path srcPath, URI[] targetFs) { | ||
| MountPoint(Path srcPath, String[] targetFs) { | ||
| mountedOnPath = srcPath; | ||
| targetFileSystemURIs = targetFs; | ||
| targetFileSystemPaths = targetFs; | ||
| } | ||
|
|
||
| public Path getMountedOnPath() { | ||
| return mountedOnPath; | ||
| } | ||
|
|
||
| public URI[] getTargetFileSystemURIs() { | ||
| return targetFileSystemURIs; | ||
| URI[] targetUris = new URI[targetFileSystemPaths.length]; | ||
| for (int i = 0; i < targetFileSystemPaths.length; i++) { | ||
| targetUris[i] = URI.create(targetFileSystemPaths[i]); | ||
| } | ||
| return targetUris; | ||
| } | ||
|
|
||
| public String[] getTargetFileSystemPaths() { | ||
|
||
| return targetFileSystemPaths; | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
What is the purpose of creating a URI and converting back to string?
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.
In the previous implementation, we were creating the URI object from the target file system path. If the path is not a valid URI, the filesystem initialization should have failed. As we are not keeping the URI object anymore, this ensures we are not dealing with an invalid URI and new URI object validates the target filesystem path.