Class NamedQueueRecorder

java.lang.Object
org.apache.hadoop.hbase.namequeues.NamedQueueRecorder

@Private @Evolving public class NamedQueueRecorder extends Object
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 Details

  • Constructor Details

    • NamedQueueRecorder

      private NamedQueueRecorder(org.apache.hadoop.conf.Configuration conf)
      Initialize disruptor with configurable ringbuffer size
  • Method Details

    • getInstance

      public static NamedQueueRecorder getInstance(org.apache.hadoop.conf.Configuration conf)
    • getEventCount

      private int getEventCount(int eventCount)
    • 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

      public boolean clearNamedQueue(NamedQueuePayload.NamedQueueEvent namedQueueEvent)
      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

      public void addRecord(NamedQueuePayload namedQueuePayload)
      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

      public void persistAll(NamedQueuePayload.NamedQueueEvent namedQueueEvent, Connection connection)
      Add all in memory queue records to system table. The implementors can use system table or direct HDFS file or ZK as persistence system.