Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Incompatible change, Reviewed
Description
FSDirectory#getListring(String src) has the following code:
int i = 0;
for (INode cur : contents)
So listing a directory will return an array of FileStatus. Each FileStatus element has the full path name. This increases the return message size and adds non-negligible CPU time to the operation.
FSDirectory#getFileInfo(String) does not need to return the file name either.
Another optimization is that in the version of FileStatus that's used in the wire protocol, the field path does not need to be Path; It could be a String or a byte array ideally. This could avoid unnecessary creation of the Path objects at NameNode, thus help reduce the GC problem observed when a large number of getFileInfo or getListing operations hit NameNode.
Attachments
Attachments
Issue Links
- is related to
-
HDFS-1743 HdfsFileStatus.getLocalName() returns an empty string when listing a full file path.
- Open