sijie 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_r158772428
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java
##########
@@ -1101,6 +1105,101 @@ public ServerConfiguration
setMajorCompactionThreshold(double threshold) {
return this;
}
+ /**
+ * Get threshold of median major compaction.
+ *
+ * <p>same with the @see #getMajorCompactionThreshold()
+ * the high threshold is used when the system is on a low load status
+ *
+ * @return threshold of median major compaction
+ */
+ public double getMedianMajorCompactionThreshold() {
+ return getDouble(MAJOR_MEDIAN_COMPACTION_THRESHOLD, 0.7f);
+ }
+
+ /**
+ * Set threshold of median major compaction.
+ *
+ * @see #getMedianMajorCompactionThreshold()
+ *
+ * @param threshold
+ * Threshold of median major compaction
+ * @return server configuration
+ */
+ public ServerConfiguration setMedianMajorCompactionThreshold(double
threshold) {
+ setProperty(MAJOR_MEDIAN_COMPACTION_THRESHOLD, threshold);
+ return this;
+ }
+
+ /**
+ * Get threshold of high major compaction.
+ *
+ * <p>same with the @see #getMajorCompactionThreshold()
+ * the high threshold is used when the system is on a very low load status
+ *
+ * @return threshold of high major compaction
+ */
+ public double getHighMajorCompactionThreshold() {
+ return getDouble(MAJOR_HIGH_COMPACTION_THRESHOLD, 0.9f);
+ }
+
+ /**
+ * Set threshold of high major compaction.
+ *
+ * @see #getHighMajorCompactionThreshold()
+ *
+ * @param threshold
+ * Threshold of major compaction
+ * @return server configuration
+ */
+ public ServerConfiguration setHighMajorCompactionThreshold(double
threshold) {
+ setProperty(MAJOR_HIGH_COMPACTION_THRESHOLD, threshold);
+ return this;
+ }
+
+ /**
+ * Get median major compaction cron expression.
+ * default is 0-3 h every day.
+ */
+ public String getMedianMajorCompactionCron() {
+ return getString(MEDIAN_MAJOR_COMPACTION_CRON, "0 * 0-3 ? * *");
+ }
+
+ /**
+ * Set median major compaction cron expression.
+ *
+ *
+ * @param medianMajorCompactionCron
+ * specified cron expression indicates median major compaction.
+ * @return server configuration
+ */
+ public ServerConfiguration setMedianMajorCompactionCron(String
medianMajorCompactionCron) {
+ setProperty(MEDIAN_MAJOR_COMPACTION_CRON, medianMajorCompactionCron);
+ return this;
+ }
+
+ /**
+ * Get high major compaction cron expression.
+ * default is 0-3 h in Saturday.
+ */
+ public String getHighMajorCompactionCron() {
+ return getString(HIGH_MAJOR_COMPACTION_CRON, "0 * 0-3 ? * 7");
Review comment:
return null as default. returning null means this feature is disabled.
----------------------------------------------------------------
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