int threadCount = getPoolSize(); if(threadCount == getMaximumPoolSize() && threadCount > realCorePoolSize) int queueSize = getQueue().size(); int currentCoreSize = getCorePoolSize(); if(queueSize < 2 && currentCoreSize > realCorePoolSize) currentCoreSize = getCorePoolSize(); if(currentCoreSize > realCorePoolSize) logger.info("Decreased pool size to " + getCorePoolSize() + " from " + currentCoreSize + " (real core size is " + realCorePoolSize + ") due to queue size of " + queueSize);
public void destroy() { this.instance.shutdown(); }
instance = new DynamicallySizedThreadPoolExecutor( corePoolSize, maximumPoolSize,
instance = new DynamicallySizedThreadPoolExecutor( corePoolSize, maximumPoolSize,
int threadCount = getPoolSize(); if(threadCount == getMaximumPoolSize() && threadCount > realCorePoolSize) int queueSize = getQueue().size(); int currentCoreSize = getCorePoolSize(); if(queueSize < 2 && currentCoreSize > realCorePoolSize) currentCoreSize = getCorePoolSize(); if(currentCoreSize > realCorePoolSize) logger.info("Decreased pool size to " + getCorePoolSize() + " from " + currentCoreSize + " (real core size is " + realCorePoolSize + ") due to queue size of " + queueSize);
private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception { CompiledModelsCache compiledModelsCache = new CompiledModelsCache(); compiledModelsCache.setDictionaryDAO(dictionaryDAO); compiledModelsCache.setTenantService(tenantService); compiledModelsCache.setRegistry(new DefaultAsynchronouslyRefreshedCacheRegistry()); TraceableThreadFactory threadFactory = new TraceableThreadFactory(); threadFactory.setThreadDaemon(true); threadFactory.setThreadPriority(Thread.NORM_PRIORITY); ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor(20, 20, 90, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); compiledModelsCache.setThreadPoolExecutor(threadPoolExecutor); dictionaryDAO.setDictionaryRegistryCache(compiledModelsCache); dictionaryDAO.init(); }
public void destroy() { this.instance.shutdown(); }
int threadCount = getPoolSize(); if(logger.isDebugEnabled()) ", current core=" + getCorePoolSize() + ", max=" + getMaximumPoolSize()); if(threadCount < getMaximumPoolSize()) int queueSize = getQueue().size() + 1;// New job not yet added if(queueSize >= getMaximumPoolSize()) int currentCoreSize = getCorePoolSize(); if(currentCoreSize < getMaximumPoolSize()) logger.info("Increased pool size to " + getCorePoolSize() + " from " + currentCoreSize + " due to queue size of " + queueSize);
int threadCount = getPoolSize(); if(logger.isDebugEnabled()) ", current core=" + getCorePoolSize() + ", max=" + getMaximumPoolSize()); if(threadCount < getMaximumPoolSize()) int queueSize = getQueue().size() + 1;// New job not yet added if(queueSize >= getMaximumPoolSize()) int currentCoreSize = getCorePoolSize(); if(currentCoreSize < getMaximumPoolSize()) logger.info("Increased pool size to " + getCorePoolSize() + " from " + currentCoreSize + " due to queue size of " + queueSize);