HDFS-15373. Fix number of threads in IPCLoggerChannel#createParallelExecutor. Contributed by Ayush Saxena.
This commit is contained in:
parent
f43a152b97
commit
6c9f75cf16
|
@ -275,12 +275,15 @@ public class IPCLoggerChannel implements AsyncLogger {
|
|||
int numThreads =
|
||||
conf.getInt(DFSConfigKeys.DFS_QJOURNAL_PARALLEL_READ_NUM_THREADS_KEY,
|
||||
DFSConfigKeys.DFS_QJOURNAL_PARALLEL_READ_NUM_THREADS_DEFAULT);
|
||||
return new ThreadPoolExecutor(1, numThreads, 60L, TimeUnit.SECONDS,
|
||||
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(numThreads,
|
||||
numThreads, 60L, TimeUnit.SECONDS,
|
||||
new LinkedBlockingQueue<>(),
|
||||
new ThreadFactoryBuilder().setDaemon(true)
|
||||
.setNameFormat("Logger channel (from parallel executor) to " + addr)
|
||||
.setUncaughtExceptionHandler(UncaughtExceptionHandlers.systemExit())
|
||||
.build());
|
||||
threadPoolExecutor.allowCoreThreadTimeOut(true);
|
||||
return threadPoolExecutor;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue