Changing the naming of Web thread pool variables

pull/246/head
chen.ma 3 years ago
parent 767bec7a48
commit 3797ff8ebf

@ -54,13 +54,25 @@ public class ThreadPoolParameterInfo implements ThreadPoolParameter, Serializabl
/** /**
* coreSize * coreSize
*/ */
@Deprecated
private Integer coreSize; private Integer coreSize;
/** /**
* maxSize * maxSize
*/ */
@Deprecated
private Integer maxSize; private Integer maxSize;
/**
* Core pool size
*/
private Integer corePoolSize;
/**
* Maximum pool size
*/
private Integer maximumPoolSize;
/** /**
* queueType * queueType
*/ */

@ -88,14 +88,14 @@ public class JettyWebThreadPoolHandler extends AbstractWebThreadPoolService {
QueuedThreadPool jettyExecutor = (QueuedThreadPool) executor; QueuedThreadPool jettyExecutor = (QueuedThreadPool) executor;
int minThreads = jettyExecutor.getMinThreads(); int minThreads = jettyExecutor.getMinThreads();
int maxThreads = jettyExecutor.getMaxThreads(); int maxThreads = jettyExecutor.getMaxThreads();
Integer coreSize = threadPoolParameterInfo.getCoreSize(); Integer coreSize = threadPoolParameterInfo.getCorePoolSize();
Integer maxSize = threadPoolParameterInfo.getMaxSize(); Integer maxSize = threadPoolParameterInfo.getMaximumPoolSize();
jettyExecutor.setMinThreads(coreSize); jettyExecutor.setMinThreads(coreSize);
jettyExecutor.setMaxThreads(maxSize); jettyExecutor.setMaxThreads(maxSize);
log.info( log.info(
"[JETTY] Changed web thread pool. " + "[JETTY] Changed web thread pool. " +
"\n coreSize :: [{}]" + "\n corePoolSize :: [{}]" +
"\n maximumSize :: [{}]", "\n maximumPoolSize :: [{}]",
String.format(CHANGE_DELIMITER, minThreads, jettyExecutor.getMinThreads()), String.format(CHANGE_DELIMITER, minThreads, jettyExecutor.getMinThreads()),
String.format(CHANGE_DELIMITER, maxThreads, jettyExecutor.getMaxThreads())); String.format(CHANGE_DELIMITER, maxThreads, jettyExecutor.getMaxThreads()));
} catch (Exception ex) { } catch (Exception ex) {

@ -119,13 +119,13 @@ public class TomcatWebThreadPoolHandler extends AbstractWebThreadPoolService {
int originalCoreSize = tomcatExecutor.getCorePoolSize(); int originalCoreSize = tomcatExecutor.getCorePoolSize();
int originalMaximumPoolSize = tomcatExecutor.getMaximumPoolSize(); int originalMaximumPoolSize = tomcatExecutor.getMaximumPoolSize();
long originalKeepAliveTime = tomcatExecutor.getKeepAliveTime(TimeUnit.SECONDS); long originalKeepAliveTime = tomcatExecutor.getKeepAliveTime(TimeUnit.SECONDS);
tomcatExecutor.setCorePoolSize(threadPoolParameterInfo.getCoreSize()); tomcatExecutor.setCorePoolSize(threadPoolParameterInfo.getCorePoolSize());
tomcatExecutor.setMaximumPoolSize(threadPoolParameterInfo.getMaxSize()); tomcatExecutor.setMaximumPoolSize(threadPoolParameterInfo.getMaximumPoolSize());
tomcatExecutor.setKeepAliveTime(threadPoolParameterInfo.getKeepAliveTime(), TimeUnit.SECONDS); tomcatExecutor.setKeepAliveTime(threadPoolParameterInfo.getKeepAliveTime(), TimeUnit.SECONDS);
log.info( log.info(
"[TOMCAT] Changed web thread pool. " + "[TOMCAT] Changed web thread pool. " +
"\n coreSize :: [{}]" + "\n corePoolSize :: [{}]" +
"\n maximumSize :: [{}]" + "\n maximumPoolSize :: [{}]" +
"\n keepAliveTime :: [{}]", "\n keepAliveTime :: [{}]",
String.format(CHANGE_DELIMITER, originalCoreSize, threadPoolParameterInfo.getCoreSize()), String.format(CHANGE_DELIMITER, originalCoreSize, threadPoolParameterInfo.getCoreSize()),
String.format(CHANGE_DELIMITER, originalMaximumPoolSize, threadPoolParameterInfo.getMaxSize()), String.format(CHANGE_DELIMITER, originalMaximumPoolSize, threadPoolParameterInfo.getMaxSize()),

@ -152,8 +152,8 @@ public class UndertowWebThreadPoolHandler extends AbstractWebThreadPoolService {
public void updateWebThreadPool(ThreadPoolParameterInfo threadPoolParameterInfo) { public void updateWebThreadPool(ThreadPoolParameterInfo threadPoolParameterInfo) {
try { try {
XnioWorker xnioWorker = (XnioWorker) executor; XnioWorker xnioWorker = (XnioWorker) executor;
Integer coreSize = threadPoolParameterInfo.getCoreSize(); Integer coreSize = threadPoolParameterInfo.getCorePoolSize();
Integer maxSize = threadPoolParameterInfo.getMaxSize(); Integer maxSize = threadPoolParameterInfo.getMaximumPoolSize();
Integer keepAliveTime = threadPoolParameterInfo.getKeepAliveTime(); Integer keepAliveTime = threadPoolParameterInfo.getKeepAliveTime();
int originalCoreSize = xnioWorker.getOption(Options.WORKER_TASK_CORE_THREADS); int originalCoreSize = xnioWorker.getOption(Options.WORKER_TASK_CORE_THREADS);
int originalMaximumPoolSize = xnioWorker.getOption(Options.WORKER_TASK_MAX_THREADS); int originalMaximumPoolSize = xnioWorker.getOption(Options.WORKER_TASK_MAX_THREADS);
@ -163,8 +163,8 @@ public class UndertowWebThreadPoolHandler extends AbstractWebThreadPoolService {
xnioWorker.setOption(Options.WORKER_TASK_KEEPALIVE, keepAliveTime); xnioWorker.setOption(Options.WORKER_TASK_KEEPALIVE, keepAliveTime);
log.info( log.info(
"[UNDERTOW] Changed web thread pool. " + "[UNDERTOW] Changed web thread pool. " +
"\n coreSize :: [{}]" + "\n corePoolSize :: [{}]" +
"\n maximumSize :: [{}]" + "\n maximumPoolSize :: [{}]" +
"\n keepAliveTime :: [{}]", "\n keepAliveTime :: [{}]",
String.format(CHANGE_DELIMITER, originalCoreSize, coreSize), String.format(CHANGE_DELIMITER, originalCoreSize, coreSize),
String.format(CHANGE_DELIMITER, originalMaximumPoolSize, maxSize), String.format(CHANGE_DELIMITER, originalMaximumPoolSize, maxSize),

Loading…
Cancel
Save