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/06/23 02:33:19 UTC

[GitHub] [bookkeeper] hangc0276 commented on a diff in pull request #3998: Fix trigger GC not work

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


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/TriggerGCService.java:
##########
@@ -61,40 +62,46 @@ public TriggerGCService(ServerConfiguration conf, BookieServer bookieServer) {
     @Override
     public HttpServiceResponse handle(HttpServiceRequest request) throws Exception {
         HttpServiceResponse response = new HttpServiceResponse();
+        try {
+            if (HttpServer.Method.PUT == request.getMethod()) {
+                String requestBody = request.getBody();
+                if (StringUtils.isBlank(requestBody)) {
+                    bookieServer.getBookie().getLedgerStorage().forceGC();
+                } else {
+                    @SuppressWarnings("unchecked")
+                    Map<String, Object> configMap = JsonUtil.fromJson(requestBody, HashMap.class);
+                    Boolean forceMajor = (Boolean) configMap.getOrDefault("forceMajor", null);

Review Comment:
   Done. 



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