Package com.mapr.baseutils.threadpool
Class GrowingThreadPool
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- java.util.concurrent.ThreadPoolExecutor
-
- com.mapr.baseutils.threadpool.GrowingThreadPool
-
- All Implemented Interfaces:
HealthCheck,java.util.concurrent.Executor,java.util.concurrent.ExecutorService
public class GrowingThreadPool extends java.util.concurrent.ThreadPoolExecutor implements HealthCheck
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
-
-
Constructor Summary
Constructors Constructor Description GrowingThreadPool(java.lang.String name, int numThreads, ThreadPoolGrowth[] growth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanProcessRequest()voidchangeGrowthRate(ThreadPoolGrowth[] newGrowth)intgetNumOfFreeSlots()voidhealthCheck()voidsetBacklog(int val)voidsetMaxPoolSize(int maxSize)-
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toString
-
-
-
-
Constructor Detail
-
GrowingThreadPool
public GrowingThreadPool(java.lang.String name, int numThreads, ThreadPoolGrowth[] growth)
-
-
Method Detail
-
changeGrowthRate
public void changeGrowthRate(ThreadPoolGrowth[] newGrowth)
-
setMaxPoolSize
public void setMaxPoolSize(int maxSize)
-
setBacklog
public void setBacklog(int val)
-
getNumOfFreeSlots
public int getNumOfFreeSlots()
-
canProcessRequest
public boolean canProcessRequest()
-
healthCheck
public void healthCheck()
- Specified by:
healthCheckin interfaceHealthCheck
-
-