E - the entity typepublic class BulkOperationUtil<E> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
BulkOperationUtil.BulkOperation<E>
The interface for the bulk operation
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(E e)
Add the given element to queue
|
static <E> BulkOperationUtil<E> |
create(int bulkPollInterval,
int capacity,
BulkOperationUtil.BulkOperation<E> bulkOperation)
Create based on parameters
|
static <E> BulkOperationUtil<E> |
create(int bulkPollInterval,
int capacity,
BulkOperationUtil.BulkOperation<E> bulkOperation,
int batchSize,
int bulkExecutorSize,
int bulkExecutorQueueCapacity)
Create based on parameters
|
void |
doBulk()
Do the bulk operation.
|
int |
getBatchSize() |
ThreadPoolExecutor |
getBulkExecutor() |
int |
getBulkExecutorQueueCapacity() |
int |
getBulkExecutorSize() |
BulkOperationUtil.BulkOperation<E> |
getBulkOperation() |
long |
getBulkPollInterval() |
Runnable |
getBulkRunnable() |
com.bluejeans.common.utils.BulkOperationUtil.Doer |
getDoer() |
int |
getMinBatchSize() |
AtomicLong |
getOfferFailCount() |
BlockingQueue<E> |
getQueue() |
int |
getQueueSize()
Get the queue size
|
boolean |
isParallel() |
boolean |
isStopped() |
void |
setBatchSize(int batchSize) |
void |
setMinBatchSize(int minBatchSize) |
void |
setParallel(boolean parallel) |
void |
stop()
Stop the utility and operate on any remaining elements in queue.
|
public static <E> BulkOperationUtil<E> create(int bulkPollInterval, int capacity, BulkOperationUtil.BulkOperation<E> bulkOperation, int batchSize, int bulkExecutorSize, int bulkExecutorQueueCapacity)
E - the entity typebulkPollInterval - the poll intervalcapacity - the queue capacitybulkOperation - the bulk operation itselfbatchSize - the drain batch sizebulkExecutorSize - the bulk executor sizepublic static <E> BulkOperationUtil<E> create(int bulkPollInterval, int capacity, BulkOperationUtil.BulkOperation<E> bulkOperation)
E - the entity typebulkPollInterval - the poll intervalcapacity - the queue capacitybulkOperation - the bulk operation itselfpublic void doBulk()
public int getQueueSize()
public void add(E e)
e - the element to addpublic void stop()
public BlockingQueue<E> getQueue()
public long getBulkPollInterval()
public BulkOperationUtil.BulkOperation<E> getBulkOperation()
public com.bluejeans.common.utils.BulkOperationUtil.Doer getDoer()
public AtomicLong getOfferFailCount()
public boolean isStopped()
public int getBatchSize()
public void setBatchSize(int batchSize)
batchSize - the batchSize to setpublic int getBulkExecutorSize()
public int getBulkExecutorQueueCapacity()
public ThreadPoolExecutor getBulkExecutor()
public Runnable getBulkRunnable()
public boolean isParallel()
public void setParallel(boolean parallel)
parallel - the parallel to setpublic int getMinBatchSize()
public void setMinBatchSize(int minBatchSize)
minBatchSize - the minBatchSize to setCopyright © 2016. All rights reserved.