T
- public abstract class DaemonBufferSplitter<T> extends EventAwareProcess implements BufferSplitter<T>, Runnable
getBUFFER_HOLD_TIME()
is reached or getMAX_BUFFER_SIZE()
is reached
Process.Event, Process.EventPoint
Modifier and Type | Field and Description |
---|---|
protected boolean |
alive |
protected int |
BUFFER_HOLD_TIME |
protected boolean |
BUFFERED_MODE |
protected int |
MAX_BUFFER_SIZE |
protected int |
MIN_BUFFER_SIZE |
listeners, processState
Constructor and Description |
---|
DaemonBufferSplitter() |
DaemonBufferSplitter(BlockingQueue<T> buffer) |
Modifier and Type | Method and Description |
---|---|
int |
getBUFFER_HOLD_TIME()
If within BUFFER_HOLD_TIME if no alert is received then it will flush the buffer.
|
BlockingQueue<T> |
getBuffer() |
int |
getMAX_BUFFER_SIZE()
MAX_BUFFER_SIZE; when count exceeds this amount it splits a batch out
buffer.size.max |
void |
kill() |
abstract void |
processBatch(List<T> batch)
Callback on the batch created as a result of this process
|
void |
refresh()
Refresh the configs and setup the BufferSplitter thread again.
|
void |
refreshConfigs()
The thread code does not directly use the config, this may cause unexpected delays and problems
depending on configs state.
|
void |
run() |
void |
setBUFFER_HOLD_TIME(int bufferHoldTime)
If within BUFFER_HOLD_TIME if no alert is received then it will flush the buffer.
|
void |
setBuffer(BlockingQueue<T> buffer)
Should be called by overriding class to set.
|
void |
setMAX_BUFFER_SIZE(int mAXBUFFERSIZE)
MAX_BUFFER_SIZE; when count exceeds this amount it splits a batch out
buffer.size.max |
addListener, getListeners, onChangeHandler, setListeners
protected boolean alive
protected boolean BUFFERED_MODE
protected int MAX_BUFFER_SIZE
protected int MIN_BUFFER_SIZE
protected int BUFFER_HOLD_TIME
public DaemonBufferSplitter()
public DaemonBufferSplitter(BlockingQueue<T> buffer)
public BlockingQueue<T> getBuffer()
public void setBuffer(BlockingQueue<T> buffer)
and keep processing the batch created by the constraints of this Buffer Splitter
buffer
- public abstract void processBatch(List<T> batch)
processBatch
in interface BufferSplitter<T>
batch
- as List
public final int getMAX_BUFFER_SIZE()
public final void setMAX_BUFFER_SIZE(int mAXBUFFERSIZE)
public final int getBUFFER_HOLD_TIME()
TimeUnit.MILLISECONDS
public final void setBUFFER_HOLD_TIME(int bufferHoldTime)
TimeUnit.MILLISECONDS
public void refreshConfigs() throws Exception
Exception
@PostConstruct public void refresh() throws Exception
Exception
Copyright © 2018. All rights reserved.