-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
HADOOP-18129: Change URI to String in INodeLink to reduce memory footprint of ViewFileSystem #3996
Conversation
💔 -1 overall
This message was automatically generated. |
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.
Can you also comment on performance implications of this change? Specifically ViewFileSystem.getTargetFileSystemPaths
may now require parsing strings into URIs on each usage, where does this impose a performance penalty?
} | ||
|
||
public Path getMountedOnPath() { | ||
return mountedOnPath; | ||
} | ||
|
||
public URI[] getTargetFileSystemURIs() { | ||
return targetFileSystemURIs; | ||
public String[] getTargetFileSystemPaths() { |
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.
This is a public method, can we keep the old signature? We can transform from string to URI within the method itself.
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.
Added getTargetFileSystemURIs where we are returning URI[]. Also added method to return targetFileSystem Paths.
targetDirLinkList = new URI[1]; | ||
targetDirLinkList[0] = aTargetDirLink; | ||
targetDirLinkList = new String[1]; | ||
targetDirLinkList[0] = new URI(aTargetDirLink).toString(); |
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.
a75520f
to
d69c720
Compare
The performance impact of this change where we are creating the URI object when its needed as well as creating a dummy URI object to check the validity of the path. |
🎊 +1 overall
This message was automatically generated. |
What do the numbers look like for the memory usage before and after this change? |
For 40k mount points, the size of ViewFileSystem reduced from 62MB to 28MB. |
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.
LGTM +1
…print of ViewFileSystem Fixes #3996
…print of ViewFileSystem Fixes apache#3996 (cherry picked from commit da9970d)
…print of ViewFileSystem Fixes apache#3996
https://issues.apache.org/jira/browse/HADOOP-18129
Description of PR
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?