Allow to re-index in verbose mode during NoteDB migration

This makes it easier to see which changes just got indexed and
correlate performance graphs with what is going on.

Change-Id: Ic3131c997102bfd476326e84dba8cc7206592bbc
This commit is contained in:
Christian Aistleitner
2020-06-14 12:25:30 +02:00
parent 11770a5658
commit c5bb255e5c

View File

@@ -101,6 +101,9 @@ public class MigrateToNoteDb extends SiteProgram {
handler = ExplicitBooleanOptionHandler.class)
private Boolean reindex;
@Option(name = "--verbose", usage = "Output more detailed information when reindexing")
private boolean verbose;
private Injector dbInjector;
private Injector sysInjector;
private LifecycleManager dbManager;
@@ -164,14 +167,18 @@ public class MigrateToNoteDb extends SiteProgram {
}
// Reindex all indices, to save the user from having to run yet another program by hand while
// their server is offline.
List<String> reindexArgs =
ImmutableList.of(
ImmutableList.Builder<String> reindexArgsBuilder = ImmutableList.builder();
reindexArgsBuilder.add(
"--site-path",
getSitePath().toString(),
"--threads",
Integer.toString(threads),
"--index",
ChangeSchemaDefinitions.NAME);
if (verbose) {
reindexArgsBuilder.add("--verbose");
}
List<String> reindexArgs = reindexArgsBuilder.build();
System.out.println("Migration complete, reindexing changes with:");
System.out.println(" reindex " + reindexArgs.stream().collect(joining(" ")));
Reindex reindexPgm = new Reindex();