diff --git a/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java b/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java index 2b681d9e076b4..9120576815bac 100644 --- a/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java +++ b/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java @@ -325,18 +325,17 @@ public static String executorName(Thread thread) { return executorName(thread.getName()); } - public static ThreadFactory daemonThreadFactory(Settings settings, String executorName) { - return createDaemonThreadFactory(threadName(settings, executorName), false); + public static ThreadFactory daemonThreadFactory(Settings settings, String namePrefix) { + return createDaemonThreadFactory(threadName(settings, namePrefix), false); } - public static ThreadFactory daemonThreadFactory(String nodeName, String executorName) { - assert nodeName != null && false == nodeName.isEmpty(); - return createDaemonThreadFactory(threadName(nodeName, executorName), false); + public static ThreadFactory daemonThreadFactory(String nodeName, String namePrefix) { + return daemonThreadFactory(nodeName, namePrefix, false); } - public static ThreadFactory daemonThreadFactory(String nodeName, String executorName, boolean isSystemThread) { + public static ThreadFactory daemonThreadFactory(String nodeName, String namePrefix, boolean isSystemThread) { assert nodeName != null && false == nodeName.isEmpty(); - return createDaemonThreadFactory(threadName(nodeName, executorName), isSystemThread); + return createDaemonThreadFactory(threadName(nodeName, namePrefix), isSystemThread); } public static ThreadFactory daemonThreadFactory(String name) { @@ -344,11 +343,6 @@ public static ThreadFactory daemonThreadFactory(String name) { return createDaemonThreadFactory(name, false); } - public static ThreadFactory daemonThreadFactory(String name, boolean isSystemThread) { - assert name != null && name.isEmpty() == false; - return createDaemonThreadFactory(name, isSystemThread); - } - private static ThreadFactory createDaemonThreadFactory(String namePrefix, boolean isSystemThread) { return new EsThreadFactory(namePrefix, isSystemThread); } diff --git a/server/src/main/java/org/elasticsearch/threadpool/FixedExecutorBuilder.java b/server/src/main/java/org/elasticsearch/threadpool/FixedExecutorBuilder.java index 9a4159e32a20e..9c723f241f1d0 100644 --- a/server/src/main/java/org/elasticsearch/threadpool/FixedExecutorBuilder.java +++ b/server/src/main/java/org/elasticsearch/threadpool/FixedExecutorBuilder.java @@ -145,7 +145,7 @@ FixedExecutorSettings getSettings(Settings settings) { ThreadPool.ExecutorHolder build(final FixedExecutorSettings settings, final ThreadContext threadContext) { int size = settings.size; int queueSize = settings.queueSize; - final ThreadFactory threadFactory = EsExecutors.daemonThreadFactory(settings.nodeName, isSystemThread()); + final ThreadFactory threadFactory = EsExecutors.daemonThreadFactory(settings.nodeName, name(), isSystemThread()); final ExecutorService executor = EsExecutors.newFixed( settings.nodeName + "/" + name(), size,