[GitHub] [hbase] cuibo01 commented on a change in pull request #2352: HBASE-24925 SCP reduce unnecessary get requests

2020-11-21 Thread GitBox


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 results = 
MetaTableAccessor.fullScan(master.getConnection(), 
ClientMetaTableAccessor.QueryType.TABLE);
+List> futures = new ArrayList<>();
+results.forEach(r -> futures.add(executorService.submit(new 
Callable() {

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




[GitHub] [hbase] cuibo01 commented on a change in pull request #2352: HBASE-24925 SCP reduce unnecessary get requests

2020-11-21 Thread GitBox


cuibo01 commented on a change in pull request #2352:
URL: https://github.com/apache/hbase/pull/2352#discussion_r528168990



##
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java
##
@@ -1556,6 +1556,7 @@ public RegionInfo loadRegionFromMeta(String 
regionEncodedName) throws UnknownReg
   }
 
   private void loadMeta() throws IOException {
+master.getTableStateManager().asyncLoadTableState();

Review comment:
   yes, scan region and scan table will be the next work. they will be 
processed together in async





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