You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/01/04 05:54:09 UTC

[GitHub] jvrao commented on a change in pull request #851: Issue 578 : make MajorCompaction controlled by time of the day/day of the week

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


With regards,
Apache Git Services