Index start/activate commands: fix Elastic support
Before this fix, the IndexStartCommand and IndexActivateCommand worked only for the Lucene index-type case. Replace the latter hard-coded case with support for it but also the Elastic case as well. Meaning, use AbstractVersionManager rather than its LuceneVersionManager sub-type, so that ElasticVersionManager can also be (seamlessly) supported for those commands. Hence bind AbstractVersionManager to the configured sub-type class, in order for it to be used that way. This change can be fully tested through using the --force option of the gerrit index start command [1]. The gerrit index activate command [2] does not have such an option. [1] https://gerrit-review.googlesource.com/Documentation/cmd-index-start.html [2] https://gerrit-review.googlesource.com/Documentation/cmd-index-activate.html Bug: Issue 8584, Issue 8585 Change-Id: Ibd8d22dca3a94e8b6a81db2935d1c34b1e80401d
This commit is contained in:
@@ -16,6 +16,7 @@ package com.google.gerrit.elasticsearch;
|
||||
|
||||
import com.google.gerrit.lifecycle.LifecycleModule;
|
||||
import com.google.gerrit.server.config.GerritServerConfig;
|
||||
import com.google.gerrit.server.index.AbstractVersionManager;
|
||||
import com.google.gerrit.server.index.IndexConfig;
|
||||
import com.google.gerrit.server.index.IndexModule;
|
||||
import com.google.gerrit.server.index.SingleVersionModule;
|
||||
@@ -67,6 +68,7 @@ public class ElasticIndexModule extends LifecycleModule {
|
||||
} else {
|
||||
install(new SingleVersionModule(singleVersions));
|
||||
}
|
||||
bind(AbstractVersionManager.class).to(ElasticVersionManager.class);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
Reference in New Issue
Block a user