Joscorbe commented on code in PR #3227:
URL: https://github.com/apache/jackrabbit-oak/pull/3227#discussion_r4380067821


##########
oak-run/src/main/java/org/apache/jackrabbit/oak/run/RevisionsCommand.java:
##########
@@ -671,16 +691,30 @@ private void collectDocument(RevisionsOptions options, 
Closer closer, String pat
         gc.setGCMonitor(new LoggingGCMonitor(LOG));
         // Set a default statistics provider
         gc.setStatisticsProvider(new 
DefaultStatisticsProvider(Executors.newSingleThreadScheduledExecutor()));
-        // Run fullGC on the given document
-        NodeDocument workingDocument = documentStore.find(NODES, 
getIdFromPath(path));
-        if (workingDocument == null) {
-            System.err.println("Document not found: " + path);
-            return;
-        }
-        gc.collectGarbageOnDocument(documentNodeStore, workingDocument, 
options.isVerbose());
+        long start = System.currentTimeMillis();
+        int notFound = 0;
+        for (int i = 0; i < paths.size(); i++) {
+            String path = paths.get(i);
+            long elapsed = System.currentTimeMillis() - start;
+            long etaMs = i == 0 ? 0 : elapsed * (paths.size() - i) / i;
+            System.out.printf("[%d/%d] elapsed %s, ETA %s - running fullGC on 
the document: %s%n",
+                    i + 1, paths.size(), fmtDuration(elapsed), 
fmtDuration(etaMs), path);
+            // Run fullGC on the given document
+            NodeDocument workingDocument = documentStore.find(NODES, 
getIdFromPath(path));
+            if (workingDocument == null) {
+                System.err.println("Document not found: " + path);
+                notFound++;
+                continue;

Review Comment:
   Tests are added



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to