You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "hangc0276 (via GitHub)" <gi...@apache.org> on 2023/03/07 00:49:34 UTC

[GitHub] [bookkeeper] hangc0276 commented on a diff in pull request #3778: Support pass threshold parameters

hangc0276 commented on code in PR #3778:
URL: https://github.com/apache/bookkeeper/pull/3778#discussion_r1127217150


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/TriggerGCService.java:
##########
@@ -71,7 +71,28 @@ public HttpServiceResponse handle(HttpServiceRequest request) throws Exception {
                 Map<String, Object> configMap = JsonUtil.fromJson(requestBody, HashMap.class);
                 Boolean forceMajor = (Boolean) configMap.getOrDefault("forceMajor", null);
                 Boolean forceMinor = (Boolean) configMap.getOrDefault("forceMinor", null);
-                bookieServer.getBookie().getLedgerStorage().forceGC(forceMajor, forceMinor);
+                Double majorCompactionThreshold = (Double) configMap.getOrDefault("majorCompactionThreshold",
+                        conf.getMajorCompactionThreshold());
+                Double minorCompactionThreshold = (Double) configMap.getOrDefault("minorCompactionThreshold",
+                        conf.getMinorCompactionThreshold());
+                Long majorCompactionMaxTimeMillis =  configMap.get(
+                        "majorCompactionMaxTimeMillis") == null ? conf.getMajorCompactionMaxTimeMillis()
+                        : Long.valueOf((Integer) configMap.get("majorCompactionMaxTimeMillis"));
+                Long minorCompactionMaxTimeMillis =  configMap.get(

Review Comment:
   We also need to make sure `minorCompactionMaxTimeMillis` and `majorCompactionMaxTimeMillis` are greater than `gcWaitTime` and add a unit test for this case.



-- 
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: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org