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
|
static <E> BulkOperationUtil<E> |
create(int bulkPollInterval,
int capacity,
String queueDir,
String queueName,
long bigQueueTimerInterval,
BulkOperationUtil.BulkOperation<E> bulkOperation,
int batchSize,
int bulkExecutorSize,
int bulkExecutorQueueCapacity)
Create based on parameters
|
void |
doBulk()
Do the bulk operation.
|
int |
getBatchSize() |
BigQueue<E> |
getBigQueue() |
Timer |
getBigQueueTimer() |
long |
getBigQueueTimerInterval() |
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() |
String |
getQueueDir() |
String |
getQueueName() |
long |
getQueueSize()
Get the queue size
|
boolean |
isFileBased() |
boolean |
isParallel() |
boolean |
isPeekEnabled() |
boolean |
isStopped() |
boolean |
isWaitEnabled() |
void |
setBatchSize(int batchSize) |
void |
setFileBased(boolean fileBased) |
void |
setMinBatchSize(int minBatchSize) |
void |
setParallel(boolean parallel) |
void |
setPeekEnabled(boolean peekEnabled) |
void |
setWaitEnabled(boolean waitEnabled) |
void |
stop()
Stop the utility and operate on any remaining elements in queue.
|
public static <E> BulkOperationUtil<E> create(int bulkPollInterval, int capacity, String queueDir, String queueName, long bigQueueTimerInterval, BulkOperationUtil.BulkOperation<E> bulkOperation, int batchSize, int bulkExecutorSize, int bulkExecutorQueueCapacity)
E - the entity typebulkPollInterval - the poll intervalqueueDir - the queue directoryqueueName - the queue namebulkOperation - 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, int batchSize, int bulkExecutorSize, int bulkExecutorQueueCapacity)
E - the entity typebulkPollInterval - the poll intervalcapacity - the queue capacitybulkOperation - the bulk operation itselfpublic 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 long getQueueSize()
public void add(E e)
e - the element to addpublic void stop()
public BlockingQueue<E> getQueue()
public boolean isFileBased()
public void setFileBased(boolean fileBased)
fileBased - the fileBased to setpublic boolean isPeekEnabled()
public void setPeekEnabled(boolean peekEnabled)
peekEnabled - the peekEnabled to setpublic boolean isWaitEnabled()
public void setWaitEnabled(boolean waitEnabled)
waitEnabled - the waitEnabled to setpublic String getQueueDir()
public String getQueueName()
public long getBigQueueTimerInterval()
public Timer getBigQueueTimer()
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.