Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Oct 16, 2024
1 parent da8d7b8 commit 2adabf0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,30 +325,24 @@ 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) {
assert name != null && name.isEmpty() == false;
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2adabf0

Please sign in to comment.