hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kih...@apache.org
Subject hadoop git commit: HDFS-11648. Lazy construct the IIP pathname. Contributed by Daryn Sharp.
Date Wed, 12 Apr 2017 19:51:28 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 c4bf50439 -> 9dfe0b351


HDFS-11648. Lazy construct the IIP pathname. Contributed by Daryn Sharp.

(cherry picked from commit 8ed230c805625549b1cecc830e909a7027bb4961)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9dfe0b35
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9dfe0b35
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9dfe0b35

Branch: refs/heads/branch-2.8
Commit: 9dfe0b35158cc0046a82cbfea2218a4ad61f329e
Parents: c4bf504
Author: Kihwal Lee <kihwal@apache.org>
Authored: Wed Apr 12 13:30:41 2017 -0500
Committer: Kihwal Lee <kihwal@apache.org>
Committed: Wed Apr 12 13:30:41 2017 -0500

----------------------------------------------------------------------
 .../org/apache/hadoop/hdfs/server/namenode/INodesInPath.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/9dfe0b35/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodesInPath.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodesInPath.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodesInPath.java
index b37321d..1d5dbf6 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodesInPath.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodesInPath.java
@@ -238,7 +238,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.
@@ -268,7 +268,6 @@ 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;
@@ -329,6 +328,9 @@ public class INodesInPath {
 
   /** @return the full path in string form */
   public String getPath() {
+    if (pathname == null) {
+      pathname = DFSUtil.byteArray2PathString(path);
+    }
     return pathname;
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message