From 352240c0485cb7f8b9529051855ee1ca97c17c64 Mon Sep 17 00:00:00 2001 From: stack Date: Wed, 4 Sep 2019 09:16:42 -0700 Subject: [PATCH] Revert "HBASE-22930 Set unique name to longCompactions/shortCompactions threads (#548)" This reverts commit b6d17f6b44867df98150410485a64ccd8cb78568. --- .../hbase/regionserver/CompactSplit.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java index 0e8fcbb5647b..46b24d05c9fc 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java @@ -119,22 +119,19 @@ public class CompactSplit implements CompactionRequester, PropagatingConfigurati Preconditions.checkArgument(largeThreads > 0 && smallThreads > 0); final String n = Thread.currentThread().getName(); - StealJobQueue stealJobQueue = new StealJobQueue(COMPARATOR); - 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()); + StealJobQueue stealJobQueue = new StealJobQueue(COMPARATOR); + this.longCompactions = new ThreadPoolExecutor(largeThreads, largeThreads, 60, + TimeUnit.SECONDS, stealJobQueue, + new ThreadFactoryBuilder() + .setNameFormat(n + "-longCompactions-" + System.currentTimeMillis()) + .setDaemon(true).build()); this.longCompactions.setRejectedExecutionHandler(new Rejection()); this.longCompactions.prestartAllCoreThreads(); - - 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()) + this.shortCompactions = new ThreadPoolExecutor(smallThreads, smallThreads, 60, + TimeUnit.SECONDS, stealJobQueue.getStealFromQueue(), + new ThreadFactoryBuilder() + .setNameFormat(n + "-shortCompactions-" + System.currentTimeMillis()) .setDaemon(true).build()); this.shortCompactions.setRejectedExecutionHandler(new Rejection()); this.splits = (ThreadPoolExecutor) Executors.newFixedThreadPool(splitThreads,