hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bha...@apache.org
Subject [hadoop] branch trunk updated: HDDS-1139 : Fix findbugs issues caused by HDDS-1085. Contributed by Aravindan Vijayan.
Date Wed, 20 Feb 2019 00:32:57 GMT
This is an automated email from the ASF dual-hosted git repository.

bharat pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e8d7e3b  HDDS-1139 : Fix findbugs issues caused by HDDS-1085. Contributed by Aravindan
Vijayan.
e8d7e3b is described below

commit e8d7e3b4e67e475f836b06180bd1f760d327f4bf
Author: avijayanhwx <avijayan@hortonworks.com>
AuthorDate: Tue Feb 19 16:32:47 2019 -0800

    HDDS-1139 : Fix findbugs issues caused by HDDS-1085. Contributed by Aravindan Vijayan.
---
 .../org/apache/hadoop/utils/db/RDBCheckpointManager.java   |  2 +-
 .../src/main/java/org/apache/hadoop/utils/db/RDBStore.java |  5 ++++-
 hadoop-hdds/common/src/main/resources/ozone-default.xml    |  9 +++++++++
 .../src/main/java/org/apache/hadoop/ozone/OmUtils.java     | 14 ++++++++++----
 .../org/apache/hadoop/ozone/om/OMDbSnapshotServlet.java    |  4 ++--
 5 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBCheckpointManager.java
b/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBCheckpointManager.java
index fe43e32..2ed2c59 100644
--- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBCheckpointManager.java
+++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBCheckpointManager.java
@@ -93,7 +93,7 @@ public class RDBCheckpointManager {
     return null;
   }
 
-  class RocksDBCheckpointSnapshot implements DBCheckpointSnapshot {
+  static class RocksDBCheckpointSnapshot implements DBCheckpointSnapshot {
 
     private Path checkpointLocation;
     private long checkpointTimestamp;
diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBStore.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBStore.java
index 6850eec..35b95b6 100644
--- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBStore.java
+++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/RDBStore.java
@@ -119,7 +119,10 @@ public class RDBStore implements DBStore {
           OM_DB_CHECKPOINTS_DIR_NAME).toString();
       File checkpointsDir = new File(checkpointsParentDir);
       if (!checkpointsDir.exists()) {
-        checkpointsDir.mkdir();
+        boolean success = checkpointsDir.mkdir();
+        if (!success) {
+          LOG.warn("Unable to create RocksDB checkpoint directory");
+        }
       }
 
       //Initialize checkpoint manager
diff --git a/hadoop-hdds/common/src/main/resources/ozone-default.xml b/hadoop-hdds/common/src/main/resources/ozone-default.xml
index 7dc6c5d..2c88faf 100644
--- a/hadoop-hdds/common/src/main/resources/ozone-default.xml
+++ b/hadoop-hdds/common/src/main/resources/ozone-default.xml
@@ -1881,4 +1881,13 @@
       jar and false for the ozone-filesystem-lib.jar
     </description>
   </property>
+  <property>
+    <name>ozone.manager.db.snapshot.transfer.bandwidthPerSec</name>
+    <value>0</value>
+    <tag>OZONE</tag>
+    <description>
+      Maximum bandwidth used for Ozone Manager DB checkpoint download through
+      the servlet.
+    </description>
+  </property>
 </configuration>
\ No newline at end of file
diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
index 093fac2..6b716ef 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
@@ -315,8 +315,10 @@ public final class OmUtils {
       tarOs = new TarArchiveOutputStream(gzipOutputStream);
       File folder = new File(sourceDir);
       File[] filesInDir = folder.listFiles();
-      for (File file : filesInDir) {
-        addFilesToArchive(file.getName(), file, tarOs);
+      if (filesInDir != null) {
+        for (File file : filesInDir) {
+          addFilesToArchive(file.getName(), file, tarOs);
+        }
       }
       return new File(fileName);
     } finally {
@@ -343,8 +345,12 @@ public final class OmUtils {
       fileInputStream.close();
     } else if (file.isDirectory()) {
       tarFileOutputStream.closeArchiveEntry();
-      for (File cFile : file.listFiles()) {
-        addFilesToArchive(cFile.getAbsolutePath(), cFile, tarFileOutputStream);
+      File[] filesInDir = file.listFiles();
+      if (filesInDir != null) {
+        for (File cFile : filesInDir) {
+          addFilesToArchive(cFile.getAbsolutePath(), cFile,
+              tarFileOutputStream);
+        }
       }
     }
   }
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDbSnapshotServlet.java
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDbSnapshotServlet.java
index 287a684..166407d 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDbSnapshotServlet.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDbSnapshotServlet.java
@@ -50,9 +50,10 @@ public class OMDbSnapshotServlet extends HttpServlet {
 
   private static final Logger LOG =
       LoggerFactory.getLogger(OMDbSnapshotServlet.class);
+  private static final long serialVersionUID = 1L;
 
   private transient DBStore omDbStore;
-  private DataTransferThrottler throttler = null;
+  private transient DataTransferThrottler throttler = null;
 
   @Override
   public void init() throws ServletException {
@@ -111,7 +112,6 @@ public class OMDbSnapshotServlet extends HttpServlet {
         response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
         return;
       }
-      LOG.info("Tar location = " + checkPointTarFile.getAbsolutePath());
       checkPointTarFile = OmUtils.createTarFile(
           checkpoint.getCheckpointLocation());
       LOG.info("Tar location = " + checkPointTarFile.getAbsolutePath());


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