hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject hbase git commit: HBASE-13726 Use commons-io to cleanup Closeables instead of hadoop IOUtils.
Date Wed, 27 May 2015 21:14:55 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 407077024 -> 4cab6963b


HBASE-13726 Use commons-io to cleanup Closeables instead of hadoop IOUtils.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4cab6963
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4cab6963
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4cab6963

Branch: refs/heads/master
Commit: 4cab6963b0c21b480ac23ff45f85925cf878ca8c
Parents: 4070770
Author: Sean Busbey <busbey@apache.org>
Authored: Wed May 20 14:03:05 2015 -0500
Committer: Sean Busbey <busbey@cloudera.com>
Committed: Wed May 27 16:04:55 2015 -0500

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/util/HBaseFsck.java   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/4cab6963/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
index cf4d002..fe4052d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
@@ -62,6 +62,7 @@ import com.google.common.collect.Multimap;
 import com.google.common.collect.Ordering;
 import com.google.common.collect.TreeMultimap;
 import com.google.protobuf.ServiceException;
+import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
@@ -134,7 +135,6 @@ import org.apache.hadoop.hbase.zookeeper.MetaTableLocator;
 import org.apache.hadoop.hbase.zookeeper.ZKUtil;
 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import org.apache.hadoop.hdfs.protocol.AlreadyBeingCreatedException;
-import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.ipc.RemoteException;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.ReflectionUtils;
@@ -435,7 +435,7 @@ public class HBaseFsck extends Configured implements Closeable {
       RetryCounter retryCounter = lockFileRetryCounterFactory.create();
       do {
         try {
-          IOUtils.closeStream(hbckOutFd);
+          IOUtils.closeQuietly(hbckOutFd);
           FSUtils.delete(FSUtils.getCurrentFileSystem(getConf()),
               HBCK_LOCK_PATH, true);
           return;
@@ -483,7 +483,7 @@ public class HBaseFsck extends Configured implements Closeable {
     Runtime.getRuntime().addShutdownHook(new Thread() {
       @Override
       public void run() {
-        IOUtils.closeStream(HBaseFsck.this);
+        IOUtils.closeQuietly(HBaseFsck.this);
         unlockHbck();
       }
     });
@@ -711,8 +711,11 @@ public class HBaseFsck extends Configured implements Closeable {
       unlockHbck();
     } catch (Exception io) {
       LOG.warn(io);
+    } finally {
+      IOUtils.closeQuietly(admin);
+      IOUtils.closeQuietly(meta);
+      IOUtils.closeQuietly(connection);
     }
-    IOUtils.cleanup(null, admin, meta, connection);
   }
 
   private static class RegionBoundariesInformation {
@@ -4660,7 +4663,7 @@ public class HBaseFsck extends Configured implements Closeable {
         setRetCode(code);
       }
     } finally {
-      IOUtils.cleanup(null, this);
+      IOUtils.closeQuietly(this);
     }
     return this;
   }


Mime
View raw message