From b09c1e8f812ae2796015dcdd8218c7bae515587c Mon Sep 17 00:00:00 2001 From: haxiaolin Date: Wed, 1 Dec 2021 16:24:45 +0800 Subject: [PATCH] HBASE-28592 Backport HBASE-26525 Use unique thread name for group WALs Change-Id: I351a7dcc8da8620ef472753f1bbdbb5a209276cf --- .../apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java index 69d5cba244da..f503b22036ac 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncFSWAL.java @@ -234,9 +234,11 @@ public AsyncFSWAL(FileSystem fs, Abortable abortable, Path rootDir, String logDi hasConsumerTask = () -> false; } } else { - ThreadPoolExecutor threadPool = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, - new LinkedBlockingQueue(), new ThreadFactoryBuilder() - .setNameFormat("AsyncFSWAL-%d-" + rootDir.toString()).setDaemon(true).build()); + ThreadPoolExecutor threadPool = + new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), + new ThreadFactoryBuilder().setNameFormat("AsyncFSWAL-%d-" + rootDir.toString() + + "-prefix:" + (prefix == null ? "default" : prefix).replace("%", "%%")).setDaemon(true) + .build()); hasConsumerTask = () -> threadPool.getQueue().peek() == consumer; this.consumeExecutor = threadPool; }