cuibo01 commented on a change in pull request #2352: URL: https://github.com/apache/hbase/pull/2352#discussion_r528169267
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableStateManager.java ########## @@ -318,4 +326,39 @@ protected void deleteZooKeeper(TableName tableName) { LOG.warn("Failed deleting table state from zookeeper", e); } } + + public void asyncLoadTableState() { + new Thread(() -> { + LOG.info("load table state..."); + ThreadFactoryBuilder builder = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("TableStateFetcher" + "-%1$d"); + ExecutorService + executorService = Executors.newFixedThreadPool(master.getConfiguration().getInt("hbase.table.state.fetcher.threads",10), builder.build()); + + try { + List<Result> results = MetaTableAccessor.fullScan(master.getConnection(), ClientMetaTableAccessor.QueryType.TABLE); + List<Future<Void>> futures = new ArrayList<>(); + results.forEach(r -> futures.add(executorService.submit(new Callable<Void>() { Review comment: By add debug log and observation, the processing result takes a lot of time. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org