@InterfaceAudience.Private class LogEventHandler extends Object implements com.lmax.disruptor.EventHandler<RingBufferEnvelope>
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOG |
private static String |
NAMED_QUEUE_PROVIDER_CLASSES |
private Map<NamedQueuePayload.NamedQueueEvent,NamedQueueService> |
namedQueueServices |
| Constructor and Description |
|---|
LogEventHandler(org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
(package private) boolean |
clearNamedQueue(NamedQueuePayload.NamedQueueEvent namedQueueEvent)
Cleans up queues maintained by services.
|
(package private) NamedQueueGetResponse |
getNamedQueueRecords(NamedQueueGetRequest request)
Retrieve in memory queue records from ringbuffer
|
void |
onEvent(RingBufferEnvelope event,
long sequence,
boolean endOfBatch)
Called when a publisher has published an event to the
RingBuffer. |
(package private) void |
persistAll(NamedQueuePayload.NamedQueueEvent namedQueueEvent)
Add all in memory queue records to system table.
|
private static final org.slf4j.Logger LOG
private final Map<NamedQueuePayload.NamedQueueEvent,NamedQueueService> namedQueueServices
private static final String NAMED_QUEUE_PROVIDER_CLASSES
LogEventHandler(org.apache.hadoop.conf.Configuration conf)
public void onEvent(RingBufferEnvelope event, long sequence, boolean endOfBatch)
RingBuffer. This is generic
consumer of disruptor ringbuffer and for each new namedQueue that we add, we should also
provide specific consumer logic here.onEvent in interface com.lmax.disruptor.EventHandler<RingBufferEnvelope>event - published to the RingBuffersequence - of the event being processedendOfBatch - flag to indicate if this is the last event in a batch from the
RingBufferboolean clearNamedQueue(NamedQueuePayload.NamedQueueEvent namedQueueEvent)
namedQueueEvent - type of queue to clearvoid persistAll(NamedQueuePayload.NamedQueueEvent namedQueueEvent)
NamedQueueGetResponse getNamedQueueRecords(NamedQueueGetRequest request)
request - namedQueue request with event typeCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.