add "same" thread pool type (really, just for testing)
This commit is contained in:
parent
585c310aa4
commit
9ac048c68c
|
@ -137,7 +137,10 @@ public class ThreadPool extends AbstractComponent {
|
||||||
}
|
}
|
||||||
String type = settings.get("type", defaultType);
|
String type = settings.get("type", defaultType);
|
||||||
ThreadFactory threadFactory = EsExecutors.daemonThreadFactory(settings, "[" + name + "]");
|
ThreadFactory threadFactory = EsExecutors.daemonThreadFactory(settings, "[" + name + "]");
|
||||||
if ("cached".equals(type)) {
|
if ("same".equals(type)) {
|
||||||
|
logger.debug("creating thread_pool [{}], type [{}]", name, type);
|
||||||
|
return MoreExecutors.sameThreadExecutor();
|
||||||
|
} else if ("cached".equals(type)) {
|
||||||
TimeValue keepAlive = settings.getAsTime("keep_alive", defaultSettings.getAsTime("keep_alive", timeValueMinutes(5)));
|
TimeValue keepAlive = settings.getAsTime("keep_alive", defaultSettings.getAsTime("keep_alive", timeValueMinutes(5)));
|
||||||
logger.debug("creating thread_pool [{}], type [{}], keep_alive [{}]", name, type, keepAlive);
|
logger.debug("creating thread_pool [{}], type [{}], keep_alive [{}]", name, type, keepAlive);
|
||||||
return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
|
return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
|
||||||
|
|
Loading…
Reference in New Issue