From 619a240ebd6305eb2fdca8efe104a9ee92065ff6 Mon Sep 17 00:00:00 2001 From: Matteo Bertozzi Date: Thu, 22 Oct 2015 09:28:33 -0700 Subject: [PATCH] HBASE-14667 HBaseFsck constructors have diverged --- .../apache/hadoop/hbase/util/HBaseFsck.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 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 49884812714..e55b53f5d20 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 @@ -313,23 +313,12 @@ public class HBaseFsck extends Configured implements Closeable { */ public HBaseFsck(Configuration conf) throws MasterNotRunningException, ZooKeeperConnectionException, IOException, ClassNotFoundException { - super(conf); - // make a copy, just to be sure we're not overriding someone else's config - setConf(HBaseConfiguration.create(getConf())); - // disable blockcache for tool invocation, see HBASE-10500 - getConf().setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0); - // Disable usage of meta replicas in hbck - getConf().setBoolean(HConstants.USE_META_REPLICAS, false); - errors = getErrorReporter(conf); + this(conf, createThreadPool(conf)); + } + private static ExecutorService createThreadPool(Configuration conf) { int numThreads = conf.getInt("hbasefsck.numthreads", MAX_NUM_THREADS); - executor = new ScheduledThreadPoolExecutor(numThreads, Threads.newDaemonThreadFactory("hbasefsck")); - lockFileRetryCounterFactory = new RetryCounterFactory( - getConf().getInt("hbase.hbck.lockfile.attempts", DEFAULT_MAX_LOCK_FILE_ATTEMPTS), - getConf().getInt( - "hbase.hbck.lockfile.attempt.sleep.interval", DEFAULT_LOCK_FILE_ATTEMPT_SLEEP_INTERVAL), - getConf().getInt( - "hbase.hbck.lockfile.attempt.maxsleeptime", DEFAULT_LOCK_FILE_ATTEMPT_MAX_SLEEP_TIME)); + return new ScheduledThreadPoolExecutor(numThreads, Threads.newDaemonThreadFactory("hbasefsck")); } /**