saintstack commented on a change in pull request #548: HBASE-22930 Set unique
name to longCompactions/shortCompactions threads
URL: https://github.com/apache/hbase/pull/548#discussion_r318322179
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java
##########
@@ -136,19 +136,22 @@ private void createCompactionExecutors() {
Preconditions.checkArgument(largeThreads > 0 && smallThreads > 0);
final String n = Thread.currentThread().getName();
-
StealJobQueue<Runnable> stealJobQueue = new
StealJobQueue<Runnable>(COMPARATOR);
- this.longCompactions = new ThreadPoolExecutor(largeThreads, largeThreads,
60,
- TimeUnit.SECONDS, stealJobQueue,
- new ThreadFactoryBuilder()
- .setNameFormat(n + "-longCompactions-" +
System.currentTimeMillis())
- .setDaemon(true).build());
+
+ AtomicInteger longCompactionThreadCounter = new AtomicInteger(0);
+ this.longCompactions =
+ new ThreadPoolExecutor(largeThreads, largeThreads, 60,
TimeUnit.SECONDS, stealJobQueue,
+ new ThreadFactoryBuilder().setNameFormat(n + "-longCompactions-"
+ + longCompactionThreadCounter.getAndIncrement() + "-" +
System.currentTimeMillis())
+ .setDaemon(true).build());
this.longCompactions.setRejectedExecutionHandler(new Rejection());
this.longCompactions.prestartAllCoreThreads();
- this.shortCompactions = new ThreadPoolExecutor(smallThreads, smallThreads,
60,
- TimeUnit.SECONDS, stealJobQueue.getStealFromQueue(),
- new ThreadFactoryBuilder()
- .setNameFormat(n + "-shortCompactions-" +
System.currentTimeMillis())
+
+ AtomicInteger shortCompactionThreadCounter = new AtomicInteger(0);
+ this.shortCompactions = new ThreadPoolExecutor(smallThreads, smallThreads,
60, TimeUnit.SECONDS,
+ stealJobQueue.getStealFromQueue(),
+ new ThreadFactoryBuilder().setNameFormat(n + "-shortCompactions-"
+ + shortCompactionThreadCounter.getAndIncrement() + "-" +
System.currentTimeMillis())
Review comment:
Does the 'n' have a thread number in it? If so, do we need this
AtomicInteger? Drop the currentTimeMillis and counter and just decorate with
-short or -long compaction addition?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services