You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/07/12 19:10:44 UTC

[GitHub] [hive] nrg4878 commented on a diff in pull request #3381: [WIP] HIVE-21456: addendum: Improvements in Thrift over HTTP for Hive MetaStore

nrg4878 commented on code in PR #3381:
URL: https://github.com/apache/hive/pull/3381#discussion_r919315254


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java:
##########
@@ -398,18 +404,16 @@ private static ThriftServer startHttpMetastore(int port, Configuration conf)
     // Server thread pool
     // Start with minWorkerThreads, expand till maxWorkerThreads and reject
     // subsequent requests
-    final String threadPoolNamePrefix = "HiveMetastore-HttpHandler-Pool";
-    ExecutorService executorService = new ThreadPoolExecutor(
-        minWorkerThreads, maxWorkerThreads, 60, TimeUnit.SECONDS,
-        new SynchronousQueue<>(), new ThreadFactory() {
-      @Override
-      public Thread newThread(@NotNull Runnable r) {
-        Thread newThread = new Thread(r);
-        newThread.setName(threadPoolNamePrefix + ": Thread-" + newThread.getId());
-        return newThread;
-      }
+    final String threadPoolNameFormat = "Metastore-HTTPHandler-Pool: Thread-%s";
+    // TODO: Add a config for keepAlive time of threads ?
+    ExecutorService executorService = new ThreadPoolExecutor(minWorkerThreads, maxWorkerThreads, 60L,
+        TimeUnit.SECONDS, new SynchronousQueue<>(), r -> {
+      Thread thread = new Thread(r);
+      thread.setDaemon(true);
+      thread.setName("Metastore-HttpHandler-Pool: Thread-" + thread.getId());

Review Comment:
   nit: should you use the "threadPoolNameFormat" variable above?



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org