jvrao commented on a change in pull request #851: Issue 578 : make 
MajorCompaction controlled by time of the day/day of the week
URL: https://github.com/apache/bookkeeper/pull/851#discussion_r159584534
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java
 ##########
 @@ -264,12 +278,53 @@ public void safeRun() {
             // collection cycle started
             forceGarbageCollection.set(false);
         }
+
+    }
+
+    /**
+     * increase the threshold when the system in low load status.
+     */
+    private void activateMedianThreshold(){
+        majorCompactionThreshold = medianMajorCompactionThreshold;
+    }
+    /**
+     * increase the threshold when the system in a very low load status.
+     */
+    private void activateHighThreshold(){
+        majorCompactionThreshold = highMajorCompactionThreshold;
+    }
+
+    /**
+     * Check whether the configured cron is met and activate threshold.
+     */
+    private void changeMajorCompactionThreshold(){
+        // next fire time is in the interval
+        if 
(medianMajorCron.nextTimeAfter(ZonedDateTime.now()).toInstant().toEpochMilli()
 
 Review comment:
   
      >  introduce cron, and be able to schedule a task based on cron.
       > don't adjust compaction thresholds, only use cron to schedule when to 
do compaction.
   
   This sums up very well. I  agree with @sijie that time-of-the-day feature 
can be helpful when entrylog-per-ledger feature is not enabled.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to