WenFeiYi commented on a change in pull request #2021:
URL: https://github.com/apache/hbase/pull/2021#discussion_r453449631



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractWALRoller.java
##########
@@ -174,18 +170,21 @@ public void run() {
         }
       }
       try {
-        this.lastRollTime = System.currentTimeMillis();
-        for (Iterator<Entry<WAL, Boolean>> iter = 
walNeedsRoll.entrySet().iterator(); iter
-          .hasNext();) {
-          Entry<WAL, Boolean> entry = iter.next();
+        for (Iterator<Entry<WAL, RollController>> iter = 
walNeedsRoll.entrySet().iterator();
+             iter.hasNext();) {
+          Entry<WAL, RollController> entry = iter.next();
+          RollController controller = entry.getValue();
+          if (!controller.isRequestRoll && !controller.isPeriodRoll(now)) {
+            continue;
+          }
           WAL wal = entry.getKey();
           // reset the flag in front to avoid missing roll request before we 
return from rollWriter.
-          walNeedsRoll.put(wal, Boolean.FALSE);
+          controller.finishRoll();

Review comment:
       Thank you very much for your tips




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to