rbalamohan commented on a change in pull request #3037:
URL: https://github.com/apache/hive/pull/3037#discussion_r811632635



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/stats/BasicStatsNoJobTask.java
##########
@@ -223,6 +227,16 @@ public void run() {
         } else {
           fileList = HiveStatsUtils.getFileStatusRecurse(dir, -1, fs);
         }
+        ThreadPoolExecutor tpE = null;
+        List<Future<FileStats>> futures = null;
+        int numThreadsFactor = HiveConf.getIntVar(jc, 
HiveConf.ConfVars.BASICSTATSTASKSMAXTHREADSFACTOR);
+        if (fileList.size() > 1 && numThreadsFactor > 0) {
+          int numThreads = Math.min(fileList.size(), numThreadsFactor * 
Runtime.getRuntime().availableProcessors());
+          tpE = new ThreadPoolExecutor(numThreads, numThreads, 0, 
TimeUnit.SECONDS, new LinkedBlockingQueue<>());

Review comment:
       Minor comment: Will be good to add threadname via ThreadFactory (will be 
easier for debugging. E.g "basic-stats-thread%")
   
   




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to