public class BatchEventProcessor extends java.lang.Object implements EventProcessor, java.lang.AutoCloseable
EventProcessor
Events passed to the BatchEventProcessor are immediately added to a BlockingQueue.
The BatchEventProcessor maintains a single consumer thread that pulls events off of
the BlockingQueue and buffers them for either a configured batch size or for a
maximum duration before the resulting LogEvent is sent to the EventHandler
and NotificationCenter.| Modifier and Type | Class and Description |
|---|---|
static class |
BatchEventProcessor.Builder |
class |
BatchEventProcessor.EventConsumer |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONFIG_BATCH_INTERVAL |
static java.lang.String |
CONFIG_BATCH_SIZE |
static java.lang.String |
CONFIG_CLOSE_TIMEOUT |
static long |
DEFAULT_BATCH_INTERVAL |
static int |
DEFAULT_BATCH_SIZE |
static int |
DEFAULT_EMPTY_COUNT |
static int |
DEFAULT_QUEUE_CAPACITY |
static long |
DEFAULT_TIMEOUT_INTERVAL |
| Modifier and Type | Method and Description |
|---|---|
static BatchEventProcessor.Builder |
builder() |
void |
close() |
void |
flush() |
void |
process(UserEvent userEvent) |
void |
start() |
public static final java.lang.String CONFIG_BATCH_SIZE
public static final java.lang.String CONFIG_BATCH_INTERVAL
public static final java.lang.String CONFIG_CLOSE_TIMEOUT
public static final int DEFAULT_QUEUE_CAPACITY
public static final int DEFAULT_EMPTY_COUNT
public static final int DEFAULT_BATCH_SIZE
public static final long DEFAULT_BATCH_INTERVAL
public static final long DEFAULT_TIMEOUT_INTERVAL
public void start()
public void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionpublic void process(UserEvent userEvent)
process in interface EventProcessorpublic void flush()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic static BatchEventProcessor.Builder builder()