You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by xy...@apache.org on 2017/04/06 21:33:46 UTC
hadoop git commit: HDFS-11362. StorageDirectory should initialize a
non-null default StorageDirType. Contribute by Hanisha Koneru.
Repository: hadoop
Updated Branches:
refs/heads/trunk 1b081ca27 -> a49fac530
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/trunk
Commit: a49fac5302128a6f5d971f5818d0fd874c3932e3
Parents: 1b081ca
Author: Xiaoyu Yao <xy...@apache.org>
Authored: Thu Apr 6 14:13:22 2017 -0700
Committer: Xiaoyu Yao <xy...@apache.org>
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: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org