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

@@ -28,12 +28,12 @@ import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.Project;
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.index.ChangeBatchIndexer;
import com.google.gerrit.server.index.ChangeIndex;
import com.google.gerrit.server.index.ChangeSchemas;
import com.google.gerrit.server.index.IndexCollection;
import com.google.gerrit.server.index.IndexModule;
import com.google.gerrit.server.index.IndexModule.IndexType;
import com.google.gerrit.server.index.SiteIndexer;
import com.google.gerrit.solr.SolrIndexModule;
import com.google.inject.Injector;
import com.google.inject.Key;
@@ -158,9 +158,9 @@ public class Reindex extends SiteProgram {
}
pm.endTask();
ChangeBatchIndexer batchIndexer =
sysInjector.getInstance(ChangeBatchIndexer.class);
ChangeBatchIndexer.Result result = batchIndexer.setNumChanges(changeCount)
SiteIndexer batchIndexer =
sysInjector.getInstance(SiteIndexer.class);
SiteIndexer.Result result = batchIndexer.setNumChanges(changeCount)
.setProgressOut(System.err)
.setVerboseOut(verbose ? System.out : NullOutputStream.INSTANCE)
.indexAll(index, projects);