Use FileSystem.openFile with FileStatus to reduce NameNode RPCs#6460
Open
dlmarion wants to merge 1 commit into
Open
Use FileSystem.openFile with FileStatus to reduce NameNode RPCs#6460dlmarion wants to merge 1 commit into
dlmarion wants to merge 1 commit into
Conversation
This commit changes how we open Hadoop files for reading. Instead of calling Filesystem.open this changes the code to use FileSystem.openFile. The openFile method returns a Builder object that has a setter method for a FileStatus object. HDFS-17593 adds logic to the DFSClient to use the located blocks in the FileStatus to reduce NameNode RPCs to get the block locations. This is useful in code where we happen to already have the FileStatus object for the associated file that we want to open.
Contributor
Author
|
The places in the 2.1 code that can currently take advantage of this are in the bulk import code, FileUtils, and RecoveryLogsIterator. FYI that HDFS-17593 has been merged into the un-released Hadoop 3.5.1 and 3.6.0 versions. The changes are compatible with the current Hadoop dependency, but not with older versions. We would need to change our minimum compatibility level for Hadoop from 3.0.3 to 3.3.0. |
Contributor
Author
|
This change requires #6461 to pass the build checks |
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.
This commit changes how we open Hadoop files for reading. Instead of calling Filesystem.open this changes the code to use FileSystem.openFile. The openFile method returns a Builder object that has a setter method for a FileStatus object. HDFS-17593 adds logic to the DFSClient to use the located blocks in the FileStatus to reduce NameNode RPCs to get the block locations. This is useful in code where we happen to already have the FileStatus object for the associated file that we want to open.