Rename ChangeBatchIndexer to SiteIndexer

The purpose of this class is to reindex the entire site, and it
contains some behaviors that are really only appropriate for this
scope, such as walking repositories to find lists of changed paths
(rather than thrashing PatchListCache), and a synchronous call
returning a results object.

This is in contrast with ReindexAfterUpdate, which operates only on
open changes in a single branch or project with an asynchronous
interface.

In fact, in each case where these different types of batch indexer can
make different choices, they do, which is why they do not share
implementation. The name "ChangeBatchIndexer", however, was too
generic, and suggested that it might be able to fulfill the role of
ReindexAfterUpdate when it can't.

Change-Id: I049746f92d98c642022b3f6a14efe78afe799519
This commit is contained in:
Dave Borowitz
2014-10-23 09:23:44 -07:00
parent 0916cc3605
commit db27fb3064
3 changed files with 14 additions and 14 deletions

View File

@@ -17,9 +17,9 @@ package com.google.gerrit.lucene;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.Lists;
import com.google.gerrit.server.index.ChangeBatchIndexer;
import com.google.gerrit.server.index.ChangeIndex;
import com.google.gerrit.server.index.IndexCollection;
import com.google.gerrit.server.index.SiteIndexer;
import com.google.gerrit.server.project.ProjectCache;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
@@ -39,14 +39,14 @@ public class OnlineReindexer {
}
private final IndexCollection indexes;
private final ChangeBatchIndexer batchIndexer;
private final SiteIndexer batchIndexer;
private final ProjectCache projectCache;
private final int version;
@Inject
OnlineReindexer(
IndexCollection indexes,
ChangeBatchIndexer batchIndexer,
SiteIndexer batchIndexer,
ProjectCache projectCache,
@Assisted int version) {
this.indexes = indexes;
@@ -76,7 +76,7 @@ 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 =
SiteIndexer.Result result =
batchIndexer.indexAll(index, projectCache.all());
if (!result.success()) {
log.error("Online reindex of schema version {} failed", version(index));