HBASE-14667 HBaseFsck constructors have diverged

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

Branch: refs/heads/hbase-12439
Commit: 619a240ebd6305eb2fdca8efe104a9ee92065ff6
Parents: 36a1967
Author: Matteo Bertozzi <matteo.berto...@cloudera.com>
Authored: Thu Oct 22 09:28:33 2015 -0700
Committer: Matteo Bertozzi <matteo.berto...@cloudera.com>
Committed: Thu Oct 22 09:28:33 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/util/HBaseFsck.java  | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/619a240e/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 4988481..e55b53f 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"));
   }
 
   /**

Reply via email to