HDFS-11648. Lazy construct the IIP pathname. Contributed by Daryn Sharp.
(cherry picked from commit8ed230c805
) (cherry picked from commit9dfe0b3515
)
This commit is contained in:
parent
81712e84fb
commit
1903665b23
|
@ -99,6 +99,9 @@ Release 2.7.4 - UNRELEASED
|
|||
|
||||
HDFS-10619. Cache path in InodesInPath. (daryn via kihwal, backported by zhz)
|
||||
|
||||
HDFS-11648. Lazy construct the IIP pathname.
|
||||
(daryn via kihwal, backported by zhz)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
HDFS-10896. Move lock logging logic from FSNamesystem into FSNamesystemLock.
|
||||
|
|
|
@ -270,7 +270,7 @@ public class INodesInPath {
|
|||
}
|
||||
|
||||
private final byte[][] path;
|
||||
private final String pathname;
|
||||
private volatile String pathname;
|
||||
|
||||
/**
|
||||
* Array with the specified number of INodes resolved for a given path.
|
||||
|
@ -293,7 +293,6 @@ public class INodesInPath {
|
|||
Preconditions.checkArgument(inodes != null && path != null);
|
||||
this.inodes = inodes;
|
||||
this.path = path;
|
||||
this.pathname = DFSUtil.byteArray2PathString(path);
|
||||
this.isSnapshot = isSnapshot;
|
||||
this.snapshotId = snapshotId;
|
||||
}
|
||||
|
@ -349,6 +348,9 @@ public class INodesInPath {
|
|||
|
||||
/** @return the full path in string form */
|
||||
public String getPath() {
|
||||
if (pathname == null) {
|
||||
pathname = DFSUtil.byteArray2PathString(path);
|
||||
}
|
||||
return pathname;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue