hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject hadoop git commit: HDFS-11783. Ozone: Fix spotbugs warnings. Contributed by Weiwei Yang.
Date Wed, 10 May 2017 18:51:58 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 cee643800 -> 38e269706


HDFS-11783. Ozone: Fix spotbugs warnings. Contributed by Weiwei Yang.


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

Branch: refs/heads/HDFS-7240
Commit: 38e269706676dcac72fc7a9e18f18930d0970dc5
Parents: cee6438
Author: Anu Engineer <aengineer@apache.org>
Authored: Wed May 10 11:40:06 2017 -0700
Committer: Anu Engineer <aengineer@apache.org>
Committed: Wed May 10 11:40:06 2017 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/cblock/meta/VolumeDescriptor.java  | 11 +----------
 .../container/common/impl/ContainerManagerImpl.java      |  6 ++++++
 .../apache/hadoop/ozone/scm/block/BlockManagerImpl.java  |  1 -
 .../java/org/apache/hadoop/ozone/scm/cli/SQLCLI.java     |  8 ++++++--
 .../hadoop/ozone/scm/container/ContainerMapping.java     |  1 -
 .../apache/hadoop/ozone/scm/node/SCMNodePoolManager.java |  1 -
 6 files changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/38e26970/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/meta/VolumeDescriptor.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/meta/VolumeDescriptor.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/meta/VolumeDescriptor.java
index 2cfc7ac..c0031ba 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/meta/VolumeDescriptor.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/cblock/meta/VolumeDescriptor.java
@@ -262,16 +262,7 @@ public class VolumeDescriptor {
           return false;
         }
       }
-      for (String containerKey : containerMap.keySet()) {
-        if (!other.containerMap.containsKey(containerKey)) {
-          return false;
-        }
-        if (!containerMap.get(containerKey).equals(
-            other.containerMap.get(containerKey))) {
-          return false;
-        }
-      }
-      return true;
+      return containerMap.equals(other.containerMap);
     }
     return false;
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/38e26970/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java
index 85e8b08..65e0e7c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java
@@ -310,6 +310,12 @@ public class ContainerManagerImpl implements ContainerManager {
       Path metadataPath = null;
       Path location = (!overwrite) ? locationManager.getContainerPath():
           Paths.get(containerData.getContainerPath()).getParent();
+      if (location == null) {
+        throw new StorageContainerException(
+            "Failed to get container file path.",
+            CONTAINER_INTERNAL_ERROR);
+      }
+
       File containerFile = ContainerUtils.getContainerFile(containerData,
           location);
       File metadataFile = ContainerUtils.getMetadataFile(containerData,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/38e26970/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
index e10274b..c570225 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
@@ -104,7 +104,6 @@ public class BlockManagerImpl implements BlockManager {
     }
     Options options = new Options();
     options.cacheSize(this.cacheSize * OzoneConsts.MB);
-    options.createIfMissing();
 
     // Write the block key to container name mapping.
     File blockContainerDbPath = new File(scmMetaDataDir, BLOCK_DB);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/38e26970/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/cli/SQLCLI.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/cli/SQLCLI.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/cli/SQLCLI.java
index 00e7814..23eb1f3 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/cli/SQLCLI.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/cli/SQLCLI.java
@@ -156,8 +156,12 @@ public class SQLCLI  extends Configured implements Tool {
       LOG.error("Error processing output path {}", outPath);
       return -1;
     }
-    if (!Files.exists(outPath.getParent())) {
-      Files.createDirectories(outPath.getParent());
+
+    Path outParentPath = outPath.getParent();
+    if (outParentPath != null) {
+      if (!Files.exists(outParentPath)) {
+        Files.createDirectories(outParentPath);
+      }
     }
     LOG.info("Parent path [{}] db name [{}]", parentPath, dbName);
     if (dbName.toString().equals(CONTAINER_DB)) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/38e26970/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
index 3b437e9..cf0076c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
@@ -87,7 +87,6 @@ public class ContainerMapping implements Mapping {
     }
     Options options = new Options();
     options.cacheSize(this.cacheSize * OzoneConsts.MB);
-    options.createIfMissing();
 
     // Write the container name to pipeline mapping.
     File containerDBPath = new File(scmMetaDataDir, CONTAINER_DB);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/38e26970/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
index 5438d2c..3ec5c1c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/node/SCMNodePoolManager.java
@@ -89,7 +89,6 @@ public final class SCMNodePoolManager implements NodePoolManager {
     }
     Options options = new Options();
     options.cacheSize(cacheSize * OzoneConsts.MB);
-    options.createIfMissing();
 
     File nodePoolDBPath = new File(scmMetaDataDir, NODEPOOL_DB);
     nodePoolStore = new LevelDBStore(nodePoolDBPath, options);


---------------------------------------------------------------------
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