Convert ChangeBatchIndexer to more of a builder pattern
There was a single method with two required and many optional arguments. Move the optional arguments into setters, except for the project count, which we just cheat and extract from the input only if the input is a Collection (which is 1 of the 2 callers). This refactoring exposes and fixes a likely unintended behavior: we should not recheck mergeability during online reindexing. The purpose of online reindexing is to get a new index schema version up and running in a timely fashion, without overloading a running server. Checking mergeability by default was not helping here; I think it was just an unintended quirk due to the way MergeabilityChecker was injected into the ChangeBatchIndexer constructor. Change-Id: Ifec986ef3c976ddeb00dd4218c5d029de9dc905e
This commit is contained in:
@@ -76,8 +76,8 @@ public class OnlineReindexer {
|
||||
"not an active write schema version: %s", version);
|
||||
log.info("Starting online reindex from schema version {} to {}",
|
||||
version(indexes.getSearchIndex()), version(index));
|
||||
ChangeBatchIndexer.Result result = batchIndexer.indexAll(
|
||||
index, projectCache.all(), -1, -1, null, null);
|
||||
ChangeBatchIndexer.Result result =
|
||||
batchIndexer.indexAll(index, projectCache.all());
|
||||
if (!result.success()) {
|
||||
log.error("Online reindex of schema version {} failed", version(index));
|
||||
return;
|
||||
|
Reference in New Issue
Block a user