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
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate static final Stringprivate final Map<NamedQueuePayload.NamedQueueEvent,NamedQueueService> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleanclearNamedQueue(NamedQueuePayload.NamedQueueEvent namedQueueEvent) Cleans up queues maintained by services.(package private) NamedQueueGetResponsegetNamedQueueRecords(NamedQueueGetRequest request) Retrieve in memory queue records from ringbuffervoidonEvent(RingBufferEnvelope event, long sequence, boolean endOfBatch) Called when a publisher has published an event to theRingBuffer.(package private) voidpersistAll(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:
onEventin interfacecom.lmax.disruptor.EventHandler<RingBufferEnvelope>- Parameters:
event- published to theRingBuffersequence- 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)
-