Q - query typeP - (sub-) processor typepublic abstract class AbstractDynamicBatchProcessor<Q,P extends BatchProcessor<Q>> extends Object implements ThreadPool, BatchProcessor<Q>
ThreadPool.PoolPolicy| Modifier and Type | Field and Description |
|---|---|
static int |
BATCH_SIZE |
static ThreadPool.PoolPolicy |
POOL_POLICY |
static int |
POOL_SIZE |
| Constructor and Description |
|---|
AbstractDynamicBatchProcessor(Supplier<? extends P> oracleSupplier,
@NonNegative int batchSize,
ExecutorService executor) |
| Modifier and Type | Method and Description |
|---|---|
protected P |
getProcessor() |
void |
processBatch(Collection<? extends Q> queries)
Process the batch.
|
void |
shutdown()
Shuts down all worker threads, but waits for any queued queries to be processed.
|
void |
shutdownNow()
Shuts down all worker threads, and attempts to abort any query processing currently taking place.
|
public static final int BATCH_SIZE
public static final int POOL_SIZE
public static final ThreadPool.PoolPolicy POOL_POLICY
public AbstractDynamicBatchProcessor(Supplier<? extends P> oracleSupplier, @NonNegative int batchSize, ExecutorService executor)
public void shutdown()
ThreadPoolshutdown in interface ThreadPoolExecutorService.shutdown()public void shutdownNow()
ThreadPoolshutdownNow in interface ThreadPoolExecutorService.shutdownNow()public void processBatch(Collection<? extends Q> queries)
BatchProcessorprocessBatch in interface BatchProcessor<Q>queries - the batch to processprotected P getProcessor()
Copyright © 2020. All rights reserved.