Class LogEventHandler
java.lang.Object
org.apache.hadoop.hbase.namequeues.LogEventHandler
- All Implemented Interfaces:
com.lmax.disruptor.EventHandler<RingBufferEnvelope>
@Private
class LogEventHandler
extends Object
implements com.lmax.disruptor.EventHandler<RingBufferEnvelope>
Event Handler run by disruptor ringbuffer consumer. Although this is generic implementation for
namedQueue, it can have individual queue specific logic.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private static final String
private final Map<NamedQueuePayload.NamedQueueEvent,
NamedQueueService> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(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 ringbuffervoid
onEvent
(RingBufferEnvelope event, long sequence, boolean endOfBatch) Called when a publisher has published an event to theRingBuffer
.(package private) void
persistAll
(NamedQueuePayload.NamedQueueEvent namedQueueEvent, Connection connection) Add all in memory queue records to system table.
-
Field Details
-
LOG
-
namedQueueServices
-
NAMED_QUEUE_PROVIDER_CLASSES
- See Also:
-
-
Constructor Details
-
LogEventHandler
LogEventHandler(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
onEvent
Called when a publisher has published an event to theRingBuffer
. This is generic consumer of disruptor ringbuffer and for each new namedQueue that we add, we should also provide specific consumer logic here.- Specified by:
onEvent
in interfacecom.lmax.disruptor.EventHandler<RingBufferEnvelope>
- Parameters:
event
- published to theRingBuffer
sequence
- of the event being processedendOfBatch
- flag to indicate if this is the last event in a batch from theRingBuffer
-
clearNamedQueue
Cleans up queues maintained by services.- Parameters:
namedQueueEvent
- type of queue to clear- Returns:
- true if queue is cleaned up, false otherwise
-
persistAll
Add all in memory queue records to system table. The implementors can use system table or direct HDFS file or ZK as persistence system. -
getNamedQueueRecords
Retrieve in memory queue records from ringbuffer- Parameters:
request
- namedQueue request with event type- Returns:
- queue records from ringbuffer after filter (if applied)
-