IndexConfig: Configure maxLimit from Config

An index implementation may not have an inherent upper bound to the
limit, but administrators may nonetheless want to restrict the maximum
query size at the server level for performance reasons.

Change-Id: Ic1f506e9857413ec860fe97785bff9e76b817db0
This commit is contained in:
Dave Borowitz
2015-04-22 16:43:54 -07:00
parent 8b6ec067e9
commit b82fbcb584
4 changed files with 35 additions and 4 deletions

View File

@@ -50,7 +50,6 @@ public class SolrIndexModule extends LifecycleModule {
@Override
protected void configure() {
bind(IndexConfig.class).toInstance(IndexConfig.createDefault());
install(new IndexModule(threads));
bind(ChangeIndex.class).to(SolrChangeIndex.class);
listener().to(SolrChangeIndex.class);
@@ -59,6 +58,12 @@ public class SolrIndexModule extends LifecycleModule {
}
}
@Provides
@Singleton
IndexConfig getIndexConfig(@GerritServerConfig Config cfg) {
return IndexConfig.fromConfig(cfg);
}
@Provides
@Singleton
public SolrChangeIndex getChangeIndex(@GerritServerConfig Config cfg,