huaxiangsun commented on code in PR #4493:
URL: https://github.com/apache/hbase/pull/4493#discussion_r890738512


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java:
##########
@@ -108,10 +117,22 @@ public FSTableDescriptors(final FileSystem fs, final Path 
rootdir) {
 
   public FSTableDescriptors(final FileSystem fs, final Path rootdir, final 
boolean fsreadonly,
     final boolean usecache) {
+    this(fs, rootdir, fsreadonly, usecache, false, 0);
+  }
+
+  public FSTableDescriptors(final FileSystem fs, final Path rootdir, final 
boolean fsreadonly,
+    final boolean usecache, final boolean tableDescriptorParallelLoadEnable,
+    final int tableDescriptorParallelLoadThreads) {
     this.fs = fs;
     this.rootdir = rootdir;
     this.fsreadonly = fsreadonly;
     this.usecache = usecache;
+    this.tableDescriptorParallelLoadEnable = tableDescriptorParallelLoadEnable;
+    if (tableDescriptorParallelLoadEnable) {
+      executor = 
Executors.newFixedThreadPool(tableDescriptorParallelLoadThreads,
+        new 
ThreadFactoryBuilder().setNameFormat("FSTableDescriptorLoad-pool-%d").setDaemon(true)
+          
.setUncaughtExceptionHandler(Threads.LOGGING_EXCEPTION_HANDLER).build());

Review Comment:
   newFixedThreadPool() will hold threads, can ThreadPoolExecutor() with 
allowCoreThreadTimeOut(true) be used instead? It allows threads to be returned 
after they are idle from some 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to