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
1 file changed
tree: 62381462bc02a95a826cc2b6fa6192b4864663a2
  1. gerrit-elasticsearch/
  2. gerrit-pgm/
  3. lib/