From d28091eeade821b5ec67061546d07fa0b6838c62 Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Wed, 20 May 2015 14:03:05 -0500 Subject: [PATCH] HBASE-13726 Use commons-io to cleanup Closeables instead of hadoop IOUtils. Conflicts: hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java --- .../java/org/apache/hadoop/hbase/util/HBaseFsck.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 b4548f61239..937c7cd0c15 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 @@ -63,6 +63,7 @@ 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.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -138,7 +139,6 @@ import org.apache.hadoop.hbase.zookeeper.ZKTableStateManager; 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; @@ -445,7 +445,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; @@ -493,7 +493,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(); } }); @@ -720,7 +720,9 @@ public class HBaseFsck extends Configured implements Closeable { @Override public void close() throws IOException { - IOUtils.cleanup(null, admin, meta, connection); + IOUtils.closeQuietly(admin); + IOUtils.closeQuietly(meta); + IOUtils.closeQuietly(connection); } private static class RegionBoundariesInformation { @@ -4694,7 +4696,7 @@ public class HBaseFsck extends Configured implements Closeable { setRetCode(code); } } finally { - IOUtils.cleanup(null, this); + IOUtils.closeQuietly(this); } return this; }