HDFS-10619. Cache path in InodesInPath. Contributed by Daryn Sharp.

This commit is contained in:
Kihwal Lee 2016-10-03 09:13:04 -05:00
parent 0da54e8848
commit 90020624b0
1 changed files with 4 additions and 1 deletions

View File

@ -278,6 +278,8 @@ public class INodesInPath {
}
private final byte[][] path;
private final String pathname;
/**
* Array with the specified number of INodes resolved for a given path.
*/
@ -306,6 +308,7 @@ public class INodesInPath {
Preconditions.checkArgument(inodes != null && path != null);
this.inodes = inodes;
this.path = path;
this.pathname = DFSUtil.byteArray2PathString(path);
this.isRaw = isRaw;
this.isSnapshot = isSnapshot;
this.snapshotId = snapshotId;
@ -366,7 +369,7 @@ public class INodesInPath {
/** @return the full path in string form */
public String getPath() {
return DFSUtil.byteArray2PathString(path);
return pathname;
}
public String getParentPath() {