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
This commit is contained in:
parent
7df1814f7f
commit
d28091eead
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue