فهرست منبع

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

(cherry picked from commit 90020624b05230ad4a7fbd666d0177ecb107a4d6)
(cherry picked from commit 3a89a8814f8e443a5f7ceddcecd6d953cfc2c6f3)
Kihwal Lee 8 سال پیش
والد
کامیت
81712e84fb

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -97,6 +97,8 @@ Release 2.7.4 - UNRELEASED
     HDFS-9726. Refactor IBR code to a new class. (Tsz-Wo Nicholas Sze
     Backport HDFS-11839 by Vinitha Reddy Gankidi)
 
+    HDFS-10619. Cache path in InodesInPath. (daryn via kihwal, backported by zhz)
+
   OPTIMIZATIONS
 
     HDFS-10896. Move lock logging logic from FSNamesystem into FSNamesystemLock.

+ 4 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodesInPath.java

@@ -270,6 +270,8 @@ public class INodesInPath {
   }
 
   private final byte[][] path;
+  private final String pathname;
+
   /**
    * Array with the specified number of INodes resolved for a given path.
    */
@@ -291,6 +293,7 @@ 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;
   }
@@ -346,7 +349,7 @@ public class INodesInPath {
 
   /** @return the full path in string form */
   public String getPath() {
-    return DFSUtil.byteArray2PathString(path);
+    return pathname;
   }
 
   public String getParentPath() {