HBASE-26525 Use unique thread name for group WALs (#3903)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Xiaolin Ha 2021-12-07 12:19:33 +08:00 committed by haxiaolin
parent 17750a72f5
commit 6d2faf4323
1 changed files with 3 additions and 2 deletions

View File

@ -239,8 +239,9 @@ public class AsyncFSWAL extends AbstractFSWAL<AsyncWriter> {
ThreadPoolExecutor threadPool = ThreadPoolExecutor threadPool =
new ThreadPoolExecutor(1, 1, 0L, new ThreadPoolExecutor(1, 1, 0L,
TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(),
new ThreadFactoryBuilder().setNameFormat("AsyncFSWAL-%d-" + rootDir.toString()). new ThreadFactoryBuilder().setNameFormat("AsyncFSWAL-%d-"+ rootDir.toString() +
setDaemon(true).build()); "-prefix:" + (prefix == null ? "default" : prefix).replace("%", "%%"))
.setDaemon(true).build());
hasConsumerTask = () -> threadPool.getQueue().peek() == consumer; hasConsumerTask = () -> threadPool.getQueue().peek() == consumer;
this.consumeExecutor = threadPool; this.consumeExecutor = threadPool;
} }