HBASE-10365 HBaseFsck should clean up connection properly when repair is completed

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1560564 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2014-01-23 00:54:05 +00:00
parent d84c5f759c
commit 1fb3e0bb93
1 changed files with 44 additions and 39 deletions

View File

@ -103,6 +103,7 @@ import org.apache.hadoop.hbase.util.hbck.TableLockChecker;
import org.apache.hadoop.hbase.zookeeper.MetaRegionTracker;
import org.apache.hadoop.hbase.zookeeper.ZKTableReadOnly;
import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.ReflectionUtils;
@ -3923,6 +3924,7 @@ public class HBaseFsck extends Configured {
// do the real work of hbck
connect();
try {
// if corrupt file mode is on, first fix them since they may be opened later
if (checkCorruptHFiles || sidelineCorruptHFiles) {
LOG.info("Checking all hfiles for corruption");
@ -3967,6 +3969,9 @@ public class HBaseFsck extends Configured {
code = onlineHbck();
setRetCode(code);
}
} finally {
IOUtils.cleanup(null, connection, meta, admin);
}
return this;
}