HDFS-11362. StorageDirectory should initialize a non-null default StorageDirType. Contribute by Hanisha Koneru.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/a49fac53 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/a49fac53 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/a49fac53 Branch: refs/heads/HDFS-7240 Commit: a49fac5302128a6f5d971f5818d0fd874c3932e3 Parents: 1b081ca 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:16 2017 -0700 ---------------------------------------------------------------------- .../java/org/apache/hadoop/hdfs/server/common/Storage.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/a49fac53/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 4493772..414d3a7 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 @@ -43,6 +43,7 @@ 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.datanode.StorageLocation; +import org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeDirType; import org.apache.hadoop.hdfs.server.protocol.NamespaceInfo; import org.apache.hadoop.io.nativeio.NativeIO; import org.apache.hadoop.io.nativeio.NativeIOException; @@ -275,12 +276,10 @@ public abstract class Storage extends StorageInfo { private final StorageLocation location; public StorageDirectory(File dir) { - // default dirType is null this(dir, null, false); } public StorageDirectory(StorageLocation location) { - // default dirType is null this(null, false, location); } @@ -337,7 +336,8 @@ public abstract class Storage extends StorageInfo { boolean isShared, StorageLocation location) { this.root = dir; this.lock = null; - this.dirType = dirType; + // default dirType is UNDEFINED + this.dirType = (dirType == null ? NameNodeDirType.UNDEFINED : dirType); this.isShared = isShared; this.location = location; assert location == null || dir == null || --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
