virajjasani commented on a change in pull request #1681:
URL: https://github.com/apache/hbase/pull/1681#discussion_r426264941
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/slowlog/LogEventHandler.java
##########
@@ -53,12 +55,28 @@
class LogEventHandler implements EventHandler<RingBufferEnvelope> {
private static final Logger LOG =
LoggerFactory.getLogger(LogEventHandler.class);
+ private static final int SYS_TABLE_QUEUE_SIZE = 1000;
- private final Queue<SlowLogPayload> queue;
+ private final Queue<SlowLogPayload> queueForRingBuffer;
+ private final Queue<SlowLogPayload> queueForSysTable;
+ private final boolean isSlowLogTableEnabled;
- LogEventHandler(int eventCount) {
+ private Configuration configuration;
+
+ private static final ReentrantLock LOCK = new ReentrantLock();
+
+ LogEventHandler(int eventCount, boolean isSlowLogTableEnabled, Configuration
conf) {
+ this.configuration = conf;
EvictingQueue<SlowLogPayload> evictingQueue =
EvictingQueue.create(eventCount);
- queue = Queues.synchronizedQueue(evictingQueue);
+ queueForRingBuffer = Queues.synchronizedQueue(evictingQueue);
+ this.isSlowLogTableEnabled = isSlowLogTableEnabled;
+ if (isSlowLogTableEnabled) {
+ EvictingQueue<SlowLogPayload> evictingQueueForTable =
EvictingQueue.create(
Review comment:
One Q is literally managed by user only and it's purpose is to server
online slowlogs from memory. Another Q is for cron to insert records in system
table in batch, hence both should not be same. Even if user clears the Q, the
one intended is in-memory ring buffer Q. If user has opted for system table,
the other Q is totally managed internally and not upto user to manage. User
might also opt for lower size for config
`hbase.regionserver.slowlog.ringbuffer.size` to say 100/50. But there is no
guarantee that within 10 min of cron run, the no of slow RPC calls would be
less than 50, and hence better to have another Q for systable maintenance.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]