@Override public int getCorePoolSize() { return this.consumeExecutor.getCorePoolSize(); }
@Override public int getCorePoolSize() { return this.consumeExecutor.getCorePoolSize(); }
/** * Value from {@link ThreadPoolExecutor#getCorePoolSize()} * * @return Number */ public Number getCurrentCorePoolSize() { return threadPool.getCorePoolSize(); }
/** * 得到最大线程数 */ public int getWorkThread() { return threadPoolExecutor.getCorePoolSize(); }
/** * 得到最大线程数 */ public int getWorkThread() { return threadPoolExecutor.getCorePoolSize(); }
@Override public int getCorePoolSize() { return pool.getCorePoolSize(); }
/** * Returns the min number of threads the channel will use for processing messages. * The channel will automatically de-allocate worker threads as the queue load shrinks, * down to the defined minimum. This lets the channel consume fewer resources when load * is low. * * @return the min number of threads that can be used by the channel. */ public int getMinThreadCount() { return executor.getCorePoolSize(); }
/** {@inheritDoc} */ @Override public int getCorePoolSize() { return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getCorePoolSize() : -1; }
protected int getSplitThreadNum() { return this.splits.getCorePoolSize(); }
protected int getSmallCompactionThreadNum() { return this.shortCompactions.getCorePoolSize(); }
public static Map<String, Object> getPoolInfo(ThreadPoolExecutor executor) { Map<String, Object> info = new HashMap<>(5); info.put("corePoolSize", executor.getCorePoolSize()); info.put("maxPoolSize", executor.getMaximumPoolSize()); info.put("activeCount(workingThread)", executor.getActiveCount()); info.put("poolSize(workThread)", executor.getPoolSize()); info.put("queueSize(blockedTask)", executor.getQueue().size()); return info; }
+ ", core:" + tp.getCorePoolSize() + ", largest:" + tp.getLargestPoolSize() + ", active:" + tp.getActiveCount()
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { if (LOGGER.isWarnEnabled()) { LOGGER.warn(LogCodes.getLog(LogCodes.ERROR_PROVIDER_TR_POOL_REJECTION, executor.getActiveCount(), executor.getPoolSize(), executor.getLargestPoolSize(), executor .getCorePoolSize(), executor.getMaximumPoolSize(), executor.getQueue() .size(), executor.getQueue().remainingCapacity())); } throw new RejectedExecutionException(); } }
+ ", core:" + tp.getCorePoolSize() + ", largest:" + tp.getLargestPoolSize() + ", active:" + tp.getActiveCount()
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { if (LOGGER.isWarnEnabled()) { LOGGER.warn(LogCodes.getLog(LogCodes.ERROR_PROVIDER_TR_POOL_REJECTION, executor.getActiveCount(), executor.getPoolSize(), executor.getLargestPoolSize(), executor .getCorePoolSize(), executor.getMaximumPoolSize(), executor.getQueue() .size(), executor.getQueue().remainingCapacity())); } throw new RejectedExecutionException(); } }
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { String msg = String.format("Thread pool is EXHAUSTED!" + " Thread Name: %s, Pool Size: %d (active: %d, core: %d, max: %d, largest: %d), Task: %d (completed: %d)," + " Executor status:(isShutdown:%s, isTerminated:%s, isTerminating:%s), in %s://%s:%d!", threadName, e.getPoolSize(), e.getActiveCount(), e.getCorePoolSize(), e.getMaximumPoolSize(), e.getLargestPoolSize(), e.getTaskCount(), e.getCompletedTaskCount(), e.isShutdown(), e.isTerminated(), e.isTerminating(), url.getProtocol(), url.getIp(), url.getPort()); logger.warn(msg); dumpJStack(); throw new RejectedExecutionException(msg); }
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { String msg = String.format("Thread pool is EXHAUSTED!" + " Thread Name: %s, Pool Size: %d (active: %d, core: %d, max: %d, largest: %d), Task: %d (completed: %d)," + " Executor status:(isShutdown:%s, isTerminated:%s, isTerminating:%s), in %s://%s:%d!", threadName, e.getPoolSize(), e.getActiveCount(), e.getCorePoolSize(), e.getMaximumPoolSize(), e.getLargestPoolSize(), e.getTaskCount(), e.getCompletedTaskCount(), e.isShutdown(), e.isTerminated(), e.isTerminating(), url.getProtocol(), url.getIp(), url.getPort()); logger.warn(msg); dumpJStack(); throw new RejectedExecutionException(msg); }
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { String msg = String.format( "Thread pool is EXHAUSTED!" + " Thread Name: %s, Pool Size: %d (active: %d, core: %d, max: %d, largest: %d), Task: %d (completed: %d)," + " Executor status:(isShutdown:%s, isTerminated:%s, isTerminating:%s)!", threadName, e.getPoolSize(), e.getActiveCount(), e.getCorePoolSize(), e.getMaximumPoolSize(), e.getLargestPoolSize(), e.getTaskCount(), e.getCompletedTaskCount(), e.isShutdown(), e.isTerminated(), e.isTerminating()); logger.warn(msg); dummper.tryThreadDump(null); throw new RejectedExecutionException(msg); }
private void rejectMessage(ChannelHandlerContext ctx, NettyMessage msg) { if (msg.isRequest()) { DefaultResponse response = new DefaultResponse(); response.setRequestId(msg.getRequestId()); response.setException(new MotanServiceException("process thread pool is full, reject by server: " + ctx.channel().localAddress(), MotanErrorMsgConstant.SERVICE_REJECT)); sendResponse(ctx, response); LoggerUtil.error("process thread pool is full, reject, active={} poolSize={} corePoolSize={} maxPoolSize={} taskCount={} requestId={}", threadPoolExecutor.getActiveCount(), threadPoolExecutor.getPoolSize(), threadPoolExecutor.getCorePoolSize(), threadPoolExecutor.getMaximumPoolSize(), threadPoolExecutor.getTaskCount(), msg.getRequestId()); rejectCounter.incrementAndGet(); } }
int threads = url.getParameter(Constants.THREADS_KEY, 0); int max = threadPoolExecutor.getMaximumPoolSize(); int core = threadPoolExecutor.getCorePoolSize(); if (threads > 0 && (threads != max || threads != core)) { if (threads < core) {