public final class StripedExecutor extends Object implements Executor
If the queue is full and the runnable implements TimeoutRunnable, then a configurable amount of blocking is done on the queue. If the runnable doesn't implement TimeoutRunnable or when the blocking times out, then the task is rejected and a RejectedExecutionException is thrown.
Modifier and Type | Field and Description |
---|---|
static AtomicLong |
THREAD_ID_GENERATOR |
Constructor and Description |
---|
StripedExecutor(ILogger logger,
String threadNamePrefix,
int threadCount,
int queueCapacity) |
StripedExecutor(ILogger logger,
String threadNamePrefix,
int threadCount,
int queueCapacity,
boolean lazyThreads) |
Modifier and Type | Method and Description |
---|---|
void |
execute(Runnable task) |
List<BlockingQueue<Runnable>> |
getTaskQueues() |
int |
getWorkQueueSize()
Returns the total number of tasks pending to be executed.
|
boolean |
isLive()
Checks if this StripedExecutor is alive (so not shut down).
|
long |
processedCount()
Returns the total number of processed events.
|
void |
shutdown()
Shuts down this StripedExecutor.
|
public static final AtomicLong THREAD_ID_GENERATOR
public StripedExecutor(ILogger logger, String threadNamePrefix, int threadCount, int queueCapacity)
public int getWorkQueueSize()
public long processedCount()
public void shutdown()
No checking is done to see if the StripedExecutor already is shut down, so it should be called only once.
If there is any pending work, it will be thrown away.
public boolean isLive()
public List<BlockingQueue<Runnable>> getTaskQueues()
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.