Repository: hadoop
Updated Branches:
  refs/heads/branch-2 84b7f2e95 -> 325be6e72


HDFS-11362. StorageDirectory should initialize a non-null default 
StorageDirType. Contribute by Hanisha Koneru.

(cherry picked from commit dde3bbf351ef3121ae80a96d06668d8fe33c788f)


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

Branch: refs/heads/branch-2
Commit: 325be6e7208c5aafe028543096120f10c1765783
Parents: 84b7f2e
Author: Xiaoyu Yao <[email protected]>
Authored: Thu Apr 6 14:13:22 2017 -0700
Committer: Xiaoyu Yao <[email protected]>
Committed: Thu Apr 6 14:33:30 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hdfs/server/common/Storage.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/325be6e7/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
index 5f340d9..5f48ead 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/Storage.java
@@ -42,6 +42,7 @@ import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.NodeType;
 import org.apache.hadoop.hdfs.server.common.HdfsServerConstants.StartupOption;
+import org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeDirType;
 import org.apache.hadoop.io.nativeio.NativeIO;
 import org.apache.hadoop.io.nativeio.NativeIOException;
 import org.apache.hadoop.util.ToolRunner;
@@ -272,7 +273,6 @@ public abstract class Storage extends StorageInfo {
     private String storageUuid = null;      // Storage directory identifier.
     
     public StorageDirectory(File dir) {
-      // default dirType is null
       this(dir, null, false);
     }
     
@@ -298,7 +298,8 @@ public abstract class Storage extends StorageInfo {
     public StorageDirectory(File dir, StorageDirType dirType, boolean 
isShared) {
       this.root = dir;
       this.lock = null;
-      this.dirType = dirType;
+      // default dirType is UNDEFINED
+      this.dirType = (dirType == null ? NameNodeDirType.UNDEFINED : dirType);
       this.isShared = isShared;
     }
     


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to