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 GitHub
parent 1004e43a44
commit bdbb4fa087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

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