ramkrish86 commented on a change in pull request #1681:
URL: https://github.com/apache/hbase/pull/1681#discussion_r427475754



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/slowlog/LogEventHandler.java
##########
@@ -256,4 +283,36 @@ private boolean 
isFilterProvided(AdminProtos.SlowLogResponseRequest request) {
     return filteredSlowLogPayloads;
   }
 
+  /**
+   * Poll from queueForSysTable and insert 100 records in hbase:slowlog table 
in single batch
+   */
+  void addAllLogsToSysTable() {
+    if (queueForSysTable == null) {
+      // hbase.regionserver.slowlog.systable.enabled is turned off. Exiting.
+      return;
+    }
+    if (LOCK.isLocked()) {
+      return;
+    }
+    LOCK.lock();
+    try {
+      List<SlowLogPayload> slowLogPayloads = new ArrayList<>();
+      int i = 0;
+      while (!queueForSysTable.isEmpty()) {
+        slowLogPayloads.add(queueForSysTable.poll());
+        i++;
+        if (i == 100) {

Review comment:
       Better to move this to constant. nit




----------------------------------------------------------------
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]


Reply via email to