You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2021/04/26 21:04:45 UTC

[GitHub] [jena] bsara commented on a change in pull request #988: Added ability to delete old DB after compaction has completed successfully

bsara commented on a change in pull request #988:
URL: https://github.com/apache/jena/pull/988#discussion_r620648331



##########
File path: jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/ctl/ActionCompact.java
##########
@@ -88,18 +88,25 @@ private static DatasetGraph unwrap(DatasetGraph dsg, Predicate<DatasetGraph> pre
     }
 
     static class CompactTask extends TaskBase {
-        static private Logger log = Fuseki.compactLog;
+        static private final Logger log = Fuseki.compactLog;
+
+        private final boolean shouldDeleteOld;
 
         public CompactTask(HttpAction action) {
             super(action);
+
+            String deleteOldParam = action.request.getParameter("deleteOld");
+
+            this.shouldDeleteOld = ( deleteOldParam != null
+                && ( deleteOldParam.isEmpty() || deleteOldParam.equalsIgnoreCase("true") ) );

Review comment:
       The reason that I coded it this way is so that the following will both trigger a deletion: `http//url/?deleteOld` & `http//url/?deleteOld=true`. Since `deleteOld` is a boolean/flag parameter, its mere presence implies `true` if no explicit value is set. This is pretty common for boolean URL params in my experience.




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org