use of com.b2international.snowowl.core.config.IndexConfiguration in project snow-owl by b2ihealthcare.
the class SnomedStatedEclEvaluationTest method setup.
@Before
public void setup() {
SnomedCoreConfiguration config = new SnomedCoreConfiguration();
config.setConcreteDomainSupported(true);
RepositoryConfiguration repositoryConfig = new RepositoryConfiguration();
IndexConfiguration indexConfiguration = new IndexConfiguration();
indexConfiguration.setResultWindow(IndexClientFactory.DEFAULT_RESULT_WINDOW);
repositoryConfig.setIndexConfiguration(indexConfiguration);
context = TestBranchContext.on(MAIN).with(EclParser.class, new DefaultEclParser(INJECTOR.getInstance(IParser.class), INJECTOR.getInstance(IResourceValidator.class))).with(EclSerializer.class, new DefaultEclSerializer(INJECTOR.getInstance(ISerializer.class))).with(Index.class, rawIndex()).with(RevisionIndex.class, index()).with(SnomedCoreConfiguration.class, config).with(RepositoryConfiguration.class, repositoryConfig).with(ResourceURI.class, CodeSystem.uri("SNOMEDCT")).build();
}
use of com.b2international.snowowl.core.config.IndexConfiguration in project snow-owl by b2ihealthcare.
the class TerminologyRepository method initIndex.
private RevisionIndex initIndex(final ServiceProvider context, Mappings mappings) {
final ObjectMapper mapper = context.service(ObjectMapper.class);
IndexConfiguration indexConfiguration = context.service(RepositoryConfiguration.class).getIndexConfiguration();
final IndexClient indexClient = Indexes.createIndexClient(repositoryId, mapper, mappings, context.service(IndexSettings.class).forIndex(indexConfiguration, repositoryId));
final Index index = new DefaultIndex(indexClient);
final RevisionIndex revisionIndex = new DefaultRevisionIndex(index, context.service(TimestampProvider.class), mapper);
revisionIndex.branching().addBranchChangeListener(path -> {
new BranchChangedEvent(repositoryId, path).publish(context.service(IEventBus.class));
});
// register IndexClient per terminology
bind(IndexClient.class, indexClient);
// register index and revision index access, the underlying index is the same
bind(Index.class, index);
bind(RevisionIndex.class, revisionIndex);
// register branching services
bind(BaseRevisionBranching.class, revisionIndex.branching());
return revisionIndex;
}
use of com.b2international.snowowl.core.config.IndexConfiguration in project snow-owl by b2ihealthcare.
the class BaseSnomedEclEvaluationRequestTest method setup.
@Before
public void setup() {
SnomedCoreConfiguration config = new SnomedCoreConfiguration();
config.setConcreteDomainSupported(true);
RepositoryConfiguration repositoryConfig = new RepositoryConfiguration();
IndexConfiguration indexConfiguration = new IndexConfiguration();
indexConfiguration.setResultWindow(IndexClientFactory.DEFAULT_RESULT_WINDOW);
repositoryConfig.setIndexConfiguration(indexConfiguration);
context = TestBranchContext.on(MAIN).with(EclParser.class, new DefaultEclParser(INJECTOR.getInstance(IParser.class), INJECTOR.getInstance(IResourceValidator.class))).with(EclSerializer.class, new DefaultEclSerializer(INJECTOR.getInstance(ISerializer.class))).with(Index.class, rawIndex()).with(RevisionIndex.class, index()).with(SnomedCoreConfiguration.class, config).with(ObjectMapper.class, getMapper()).with(TerminologyResource.class, createCodeSystem(MAIN)).with(ResourceURI.class, CodeSystem.uri("SNOMEDCT")).with(RepositoryConfiguration.class, repositoryConfig).build();
}
use of com.b2international.snowowl.core.config.IndexConfiguration in project snow-owl by b2ihealthcare.
the class RepositoryPlugin method initIndexSettings.
private Map<String, Object> initIndexSettings(Environment env) {
final RepositoryConfiguration repositoryConfig = env.service(RepositoryConfiguration.class);
final IndexConfiguration indexConfig = repositoryConfig.getIndexConfiguration();
final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
indexConfig.configure(builder);
builder.put(IndexClientFactory.DATA_DIRECTORY, env.getDataPath().resolve("indexes").toString());
builder.put(IndexClientFactory.CONFIG_DIRECTORY, env.getConfigPath().toString());
builder.put(IndexClientFactory.INDEX_PREFIX, repositoryConfig.getDeploymentId());
return builder.build();
}
Aggregations