nfsantos commented on code in PR #1669:
URL: https://github.com/apache/jackrabbit-oak/pull/1669#discussion_r1732737698


##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/DocumentStoreIndexerBase.java:
##########
@@ -357,26 +369,37 @@ public void reindex() throws CommitFailedException, 
IOException {
                     indexParallel(flatFileStores, indexer, progressReporter);
                 } else if (flatFileStores.size() == 1) {
                     FlatFileStore flatFileStore = flatFileStores.get(0);
-                    TopKSlowestPaths slowestTopKElements = new 
TopKSlowestPaths(TOP_SLOWEST_PATHS_TO_LOG);
-                    indexer.onIndexingStarting();
-                    long entryStart = System.nanoTime();
-                    for (NodeStateEntry entry : flatFileStore) {
-                        reportDocumentRead(entry.getPath(), progressReporter);
-                        indexer.index(entry);
-                        // Avoid calling System.nanoTime() twice per each 
entry, by reusing the timestamp taken at the end
-                        // of indexing an entry as the start time of the 
following entry. This is less accurate, because
-                        // the measured times will also include the 
bookkeeping at the end of indexing each entry, but
-                        // we are only interested in entries that take a 
significant time to index, so this extra
-                        // inaccuracy will not significantly change the 
results.
-                        long entryEnd = System.nanoTime();
-                        long elapsedMillis = (entryEnd - entryStart) / 
1_000_000;
-                        entryStart = entryEnd;
-                        slowestTopKElements.add(entry.getPath(), 
elapsedMillis);
-                        if (elapsedMillis > 1000) {
-                            log.info("Indexing {} took {} ms", 
entry.getPath(), elapsedMillis);
+                    try (AheadOfTimeBlobDownloader aheadOfTimeBlobDownloader = 
getAheadOfTimeBlobDownloaderInterface(flatFileStore, indexer)) {

Review Comment:
   As discussed in person, could you suggest a refactoring of this PR to remove 
the dependency from the DocumentStoreIndexerBase to the 
AheadOfTimeBlobDownloader? I gave it a try but I did not find any obvious and 
simple way to do it.



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