use of com.google.gerrit.index.SchemaDefinitions in project gerrit by GerritCodeReview.
the class Init method afterInit.
@Override
protected void afterInit(SiteRun run) throws Exception {
List<SchemaDefinitions<?>> schemaDefs = ImmutableList.of(AccountSchemaDefinitions.INSTANCE, ChangeSchemaDefinitions.INSTANCE, GroupSchemaDefinitions.INSTANCE, ProjectSchemaDefinitions.INSTANCE);
List<Module> modules = new ArrayList<>();
modules.add(new AbstractModule() {
@Override
protected void configure() {
bind(Path.class).annotatedWith(SitePath.class).toInstance(getSitePath());
bind(Browser.class);
bind(String.class).annotatedWith(SecureStoreClassName.class).toProvider(Providers.of(getConfiguredSecureStoreClass()));
}
});
modules.add(new GerritServerConfigModule());
Guice.createInjector(modules).injectMembers(this);
if (!ReplicaUtil.isReplica(run.flags.cfg)) {
List<String> indicesToReindex = new ArrayList<>();
for (SchemaDefinitions<?> schemaDef : schemaDefs) {
if (!indexStatus.exists(schemaDef.getName())) {
indicesToReindex.add(schemaDef.getName());
}
}
reindex(indicesToReindex, run.flags.isNew);
}
start(run);
}
Aggregations