Browse Source

HDFS-1028. Efficient splitting of path components reduces the time
to load in fsimage by 20%. (Dmytro Molkov via dhruba)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@942003 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 15 năm trước cách đây
mục cha
commit
087ad43627
2 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 3 0
      CHANGES.txt
  2. 2 1
      src/java/org/apache/hadoop/hdfs/server/namenode/INode.java

+ 3 - 0
CHANGES.txt

@@ -499,6 +499,9 @@ Release 0.21.0 - Unreleased
     HDFS-1089. Remove uses of FileContext#isFile, isDirectory, and exists.
     (Eli Collins via hairong)
 
+    HDFS-1028. Efficient splitting of path components reduces the time
+    to load in fsimage by 20%. (Dmytro Molkov via dhruba)
+
   OPTIMIZATIONS
 
     HDFS-946. NameNode should not return full path name when lisitng a

+ 2 - 1
src/java/org/apache/hadoop/hdfs/server/namenode/INode.java

@@ -25,6 +25,7 @@ import org.apache.hadoop.fs.ContentSummary;
 import org.apache.hadoop.fs.permission.*;
 import org.apache.hadoop.hdfs.DFSUtil;
 import org.apache.hadoop.hdfs.protocol.Block;
+import org.apache.hadoop.util.StringUtils;
 
 /**
  * We keep an in-memory representation of the file/block hierarchy.
@@ -357,7 +358,7 @@ abstract class INode implements Comparable<byte[]>, FSInodeInfo {
     if (path == null || !path.startsWith(Path.SEPARATOR)) {
       throw new AssertionError("Absolute path required");
     }
-    return path.split(Path.SEPARATOR);
+    return StringUtils.split(path, Path.SEPARATOR_CHAR);
   }
 
   /**