Class NamedQueueRecorder
java.lang.Object
org.apache.hadoop.hbase.namequeues.NamedQueueRecorder
NamedQueue recorder that maintains various named queues. The service uses LMAX Disruptor to save
queue records which are then consumed by a queue and based on the ring buffer size, the available
records are then fetched from the queue in thread-safe manner.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final com.lmax.disruptor.dsl.Disruptor<RingBufferEnvelope>
private static boolean
private static final Object
private final LogEventHandler
private static NamedQueueRecorder
-
Constructor Summary
ModifierConstructorDescriptionprivate
NamedQueueRecorder
(org.apache.hadoop.conf.Configuration conf) Initialize disruptor with configurable ringbuffer size -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRecord
(NamedQueuePayload namedQueuePayload) Add various NamedQueue records to ringbuffer.boolean
clearNamedQueue
(NamedQueuePayload.NamedQueueEvent namedQueueEvent) clears queue records from ringbufferprivate int
getEventCount
(int eventCount) static NamedQueueRecorder
getInstance
(org.apache.hadoop.conf.Configuration conf) getNamedQueueRecords
(NamedQueueGetRequest request) Retrieve in memory queue records from ringbuffervoid
persistAll
(NamedQueuePayload.NamedQueueEvent namedQueueEvent, Connection connection) Add all in memory queue records to system table.
-
Field Details
-
disruptor
-
logEventHandler
-
namedQueueRecorder
-
isInit
-
LOCK
-
-
Constructor Details
-
NamedQueueRecorder
Initialize disruptor with configurable ringbuffer size
-
-
Method Details
-
getInstance
-
getEventCount
-
getNamedQueueRecords
Retrieve in memory queue records from ringbuffer- Parameters:
request
- namedQueue request with event type- Returns:
- queue records from ringbuffer after filter (if applied)
-
clearNamedQueue
clears queue records from ringbuffer- Parameters:
namedQueueEvent
- type of queue to clear- Returns:
- true if slow log payloads are cleaned up or hbase.regionserver.slowlog.buffer.enabled is not set to true, false if failed to clean up slow logs
-
addRecord
Add various NamedQueue records to ringbuffer. Based on the type of the event (e.g slowLog), consumer of disruptor ringbuffer will have specific logic. This method is producer of disruptor ringbuffer which is initialized in NamedQueueRecorder constructor.- Parameters:
namedQueuePayload
- namedQueue payload sent by client of ring buffer service
-
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.
-