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
|
static class |
BulkOperationUtil.BulkStatus |
| 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
|
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,
boolean start)
Create based on parameters
|
void |
doBulk()
Do the bulk operation.
|
void |
dummyElementIs(E el) |
void |
entityTypeIs(Class<E> entityType) |
int |
getBatchSize() |
BigQueue<E> |
getBigQueue() |
Timer |
getBigQueueTimer() |
long |
getBigQueueTimerInterval() |
ThreadPoolExecutor |
getBulkExecutor() |
int |
getBulkExecutorQueueCapacity() |
int |
getBulkExecutorSize() |
BulkOperationUtil.BulkOperation<E> |
getBulkOperation() |
long |
getBulkPollInterval() |
int |
getBulkRetryCount() |
Runnable |
getBulkRunnable() |
EnumCounter<BulkOperationUtil.BulkStatus> |
getBulkStatusCounter() |
com.bluejeans.utils.BulkOperationUtil.Doer |
getDoer() |
E |
getDummyElement() |
Class<?> |
getEntityType() |
int |
getMinBatchSize() |
BlockingQueue<E> |
getQueue() |
AtomicLong |
getQueueAddFailCount() |
String |
getQueueDir() |
String |
getQueueName() |
long |
getQueueSize()
Get the queue size
|
boolean |
isBulkRetryEnabled() |
boolean |
isFileBased() |
boolean |
isParallel() |
boolean |
isPeekEnabled() |
boolean |
isStopped() |
boolean |
isWaitEnabled() |
void |
setBatchSize(int batchSize) |
void |
setBulkRetryCount(int bulkRetryCount) |
void |
setBulkRetryEnabled(boolean bulkRetryEnabled) |
void |
setDummyElement(E dummyElement) |
void |
setEntityType(Class<E> entityType) |
void |
setFileBased(boolean fileBased) |
void |
setMinBatchSize(int minBatchSize) |
void |
setParallel(boolean parallel) |
void |
setPeekEnabled(boolean peekEnabled) |
void |
setWaitEnabled(boolean waitEnabled) |
void |
start()
start
|
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, boolean start)
E - the entity typebulkPollInterval - the poll intervalcapacity - the queue capacityqueueDir - the queue directoryqueueName - the queue namebigQueueTimerInterval - the bigQueueTimerIntervalbulkOperation - the bulk operation itselfbatchSize - the drain batch sizebulkExecutorSize - the bulk executor sizebulkExecutorQueueCapacity - the bulkExecutorQueueCapacitystart - start on create?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 intervalcapacity - the queue capacityqueueDir - the queue directoryqueueName - the queue namebigQueueTimerInterval - the bigQueueTimerIntervalbulkOperation - the bulk operation itselfbatchSize - the drain batch sizebulkExecutorSize - the bulk executor sizebulkExecutorQueueCapacity - the bulkExecutorQueueCapacitypublic 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 sizebulkExecutorQueueCapacity - the bulkExecutorQueueCapacitypublic 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 start()
public 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.utils.BulkOperationUtil.Doer getDoer()
public AtomicLong getQueueAddFailCount()
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 setpublic boolean isBulkRetryEnabled()
public void setBulkRetryEnabled(boolean bulkRetryEnabled)
bulkRetryEnabled - the bulkRetryEnabled to setpublic int getBulkRetryCount()
public void setBulkRetryCount(int bulkRetryCount)
bulkRetryCount - the bulkRetryCount to setpublic EnumCounter<BulkOperationUtil.BulkStatus> getBulkStatusCounter()
public Class<?> getEntityType()
public void setEntityType(Class<E> entityType)
entityType - the entityType to setpublic E getDummyElement()
public void setDummyElement(E dummyElement)
dummyElement - the dummyElement to setpublic void dummyElementIs(E el)
Copyright © 2017. All rights reserved.