public class MemoryLimitedTaskQueue<R extends java.lang.Runnable> extends MemoryLimitedLinkedBlockingQueue<java.lang.Runnable> implements TaskQueue<java.lang.Runnable>
ShenyuThreadPoolExecutor.
It offer a task if the executor's submittedTaskCount less than currentPoolThreadSize
or the currentPoolThreadSize more than executor's maximumPoolSize.
That can make the executor create new worker
when the task num is bigger than corePoolSize but less than maximumPoolSize.| Constructor and Description |
|---|
MemoryLimitedTaskQueue(java.lang.instrument.Instrumentation inst) |
MemoryLimitedTaskQueue(long memoryLimit,
java.lang.instrument.Instrumentation inst) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
doOffer(java.lang.Runnable runnable)
offer element to the queue.
|
EagerExecutorService |
getExecutor()
get executor.
|
void |
setExecutor(EagerExecutorService executor)
set the executor.
|
clear, getCurrentMemory, getCurrentRemainMemory, getMemoryLimit, offer, offer, poll, poll, put, remove, setMemoryLimit, takecontains, drainTo, drainTo, iterator, peek, remainingCapacity, size, spliterator, toArray, toArray, toStringcontainsAll, isEmpty, removeAll, retainAllclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitoffer, retryOfferadd, contains, drainTo, drainTo, offer, poll, put, remainingCapacity, remove, takepublic MemoryLimitedTaskQueue(java.lang.instrument.Instrumentation inst)
public MemoryLimitedTaskQueue(long memoryLimit,
java.lang.instrument.Instrumentation inst)
public EagerExecutorService getExecutor()
TaskQueuegetExecutor in interface TaskQueue<java.lang.Runnable>public void setExecutor(EagerExecutorService executor)
TaskQueuesetExecutor in interface TaskQueue<java.lang.Runnable>executor - executorpublic boolean doOffer(java.lang.Runnable runnable)
TaskQueueCopyright © 2024 The Apache Software Foundation. All rights reserved.