@@ -769,27 +769,26 @@ private void processTrailingTerms(String startUid, boolean usedHistory, IndexDow
769
769
*/
770
770
@ VisibleForTesting
771
771
boolean getIndexDownArgs (String dir , File sourceRoot , IndexDownArgs args ) throws IOException {
772
- Statistics elapsed = new Statistics ();
773
- boolean usedHistory = false ;
774
-
775
772
RuntimeEnvironment env = RuntimeEnvironment .getInstance ();
773
+ boolean historyBased = isReadyForHistoryBasedReindex ();
776
774
777
- if (isReadyForHistoryBasedReindex ()) {
778
- LOGGER .log (Level .INFO , "Starting file collection using history traversal for directory {0}" , dir );
775
+ if (LOGGER .isLoggable (Level .INFO )) {
776
+ LOGGER .log (Level .INFO , String .format ("Starting file collection using %s traversal for directory '%s'" ,
777
+ historyBased ? "history" : "file-system" , dir ));
778
+ }
779
+ Statistics elapsed = new Statistics ();
780
+ if (historyBased ) {
779
781
indexDownUsingHistory (env .getSourceRootFile (), args );
780
- usedHistory = true ;
781
- elapsed .report (LOGGER , String .format ("Done file collection for directory %s" , dir ),
782
- "indexer.db.directory.collection" );
783
782
} else {
784
- LOGGER .log (Level .INFO , "Starting file collection using file-system traversal of directory {0}" , dir );
785
783
indexDown (sourceRoot , dir , args );
786
- elapsed .report (LOGGER , String .format ("Done traversal of directory %s" , dir ),
787
- "indexer.db.directory.traversal" );
788
784
}
789
785
786
+ elapsed .report (LOGGER , String .format ("Done file collection for directory '%s'" , dir ),
787
+ "indexer.db.collection" );
788
+
790
789
showFileCount (dir , args );
791
790
792
- return usedHistory ;
791
+ return historyBased ;
793
792
}
794
793
795
794
/**
0 commit comments