Merge "Add an optional flag to force an online reindex"

This commit is contained in:
Hugo Arès
2016-08-03 13:18:35 +00:00
committed by Gerrit Code Review
3 changed files with 15 additions and 7 deletions

View File

@@ -23,11 +23,15 @@ import com.google.gerrit.sshd.SshCommand;
import com.google.inject.Inject;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
@CommandMetaData(name = "start", description = "Start the online reindexer")
public class IndexStartCommand extends SshCommand {
@Option(name = "--force", usage = "force a re-index")
private boolean force;
@Argument(index = 0, required = true, metaVar = "INDEX",
usage = "index name to start")
private String name;
@@ -38,7 +42,7 @@ public class IndexStartCommand extends SshCommand {
@Override
protected void run() throws UnloggedFailure {
try {
if (luceneVersionManager.startReindexer(name)) {
if (luceneVersionManager.startReindexer(name, force)) {
stdout.println("Reindexer started");
} else {
stdout.println("Nothing to reindex, index is already the latest version");