wchevreuil commented on code in PR #5528:
URL: https://github.com/apache/hbase/pull/5528#discussion_r1397382901


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java:
##########
@@ -398,4 +414,33 @@ public void archiveMetaLog(final ServerName serverName) {
       LOG.warn("Failed archiving meta log for server " + serverName, ie);
     }
   }
+
+  private static Stoppable createDummyStoppable() {
+    return new Stoppable() {
+      private volatile boolean isStopped = false;
+
+      @Override
+      public void stop(String why) {
+        isStopped = true;
+      }
+
+      @Override
+      public boolean isStopped() {
+        return isStopped;
+      }
+    };
+  }
+
+  public ScheduledChore getOldWALsDirSizeUpdaterChore() {

Review Comment:
   Can we have this Chore imlemented on its own class? That way we don't need 
to define new methods on MasterWalManager that just concerns this Chore logic, 
like the `createDummyStoppable` and `updateWalDirSize()` above.



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterWalManager.java:
##########
@@ -398,4 +414,33 @@ public void archiveMetaLog(final ServerName serverName) {
       LOG.warn("Failed archiving meta log for server " + serverName, ie);
     }
   }
+
+  private static Stoppable createDummyStoppable() {
+    return new Stoppable() {
+      private volatile boolean isStopped = false;
+
+      @Override
+      public void stop(String why) {
+        isStopped = true;
+      }
+
+      @Override
+      public boolean isStopped() {
+        return isStopped;
+      }
+    };
+  }
+
+  public ScheduledChore getOldWALsDirSizeUpdaterChore() {
+    return new ScheduledChore("UpdateOldWALsDirSize", createDummyStoppable(), 
OLD_WAL_DIR_UPDATE_INTERVAL) {

Review Comment:
   Can we make this interval configurable? This way we could also give the 
option to disable this chore altogether.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to