Add secondary index implementation using SolrCloud

SolrCloud can be used instead of Lucene by adding "type = SOLR"
under [index] and "url = <zookeeper-url>" under [index "solr"]
in gerrit.config.

Change-Id: I0ff8579c5e23c58b16f3605bc20eba4e80fb40fc
This commit is contained in:
Ahaan Ugale
2013-06-12 17:22:19 -06:00
committed by Shawn Pearce
parent 9279b29da7
commit 404c8246bc
23 changed files with 940 additions and 284 deletions

View File

@@ -36,9 +36,15 @@ import org.eclipse.jgit.lib.Config;
* implementations (e.g. Lucene).
*/
public class IndexModule extends AbstractModule {
public static boolean isEnabled(Injector injector) {
return injector.getInstance(Key.get(Config.class, GerritServerConfig.class))
.getBoolean("index", null, "enabled", false);
public enum IndexType {
SQL, LUCENE, SOLR;
}
/** Type of secondary index. */
public static IndexType getIndexType(Injector injector) {
Config cfg = injector.getInstance(
Key.get(Config.class, GerritServerConfig.class));
return cfg.getEnum("index", null, "type", IndexType.SQL);
}
private final int threads;