Skip to content

Commit

Permalink
HBASE-22930 Set unique name to longCompactions/shortCompactions/split…
Browse files Browse the repository at this point in the history
… threads (#585)
  • Loading branch information
Pankaj authored and petersomogyi committed Sep 22, 2019
1 parent 38c8bd3 commit 6fe7063
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ private void createSplitExcecutors() {
final String n = Thread.currentThread().getName();
int splitThreads = conf.getInt(SPLIT_THREADS, SPLIT_THREADS_DEFAULT);
this.splits = (ThreadPoolExecutor) Executors.newFixedThreadPool(splitThreads,
new ThreadFactoryBuilder().setNameFormat(n + "-splits-" + System.currentTimeMillis())
.setDaemon(true).build());
new ThreadFactoryBuilder().setNameFormat(n + "-splits-%d").setDaemon(true).build());
}

private void createCompactionExecutors() {
Expand All @@ -138,18 +137,14 @@ private void createCompactionExecutors() {
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())
this.longCompactions = new ThreadPoolExecutor(largeThreads, largeThreads, 60, TimeUnit.SECONDS,
stealJobQueue, new ThreadFactoryBuilder().setNameFormat(n + "-longCompactions-%d")
.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())
.setDaemon(true).build());
this.shortCompactions = new ThreadPoolExecutor(smallThreads, smallThreads, 60, TimeUnit.SECONDS,
stealJobQueue.getStealFromQueue(), new ThreadFactoryBuilder()
.setNameFormat(n + "-shortCompactions-%d").setDaemon(true).build());
this.shortCompactions.setRejectedExecutionHandler(new Rejection());
}

Expand Down

0 comments on commit 6fe7063

Please sign in to comment.