Search in sources :

Example 16 with Index

use of com.b2international.index.Index in project snow-owl by b2ihealthcare.

the class RepositoryPlugin method initializeJobSupport.

private void initializeJobSupport(Environment env, SnowOwlConfiguration configuration) {
    final ObjectMapper objectMapper = env.service(ObjectMapper.class);
    final Index jobsIndex = Indexes.createIndex(JOBS_INDEX, objectMapper, new Mappings(RemoteJobEntry.class), env.service(IndexSettings.class).forIndex(env.service(RepositoryConfiguration.class).getIndexConfiguration(), JOBS_INDEX));
    // TODO make this configurable
    final long defaultJobCleanUpInterval = TimeUnit.MINUTES.toMillis(1);
    env.services().registerService(RemoteJobTracker.class, new RemoteJobTracker(jobsIndex, env.service(IEventBus.class), objectMapper, defaultJobCleanUpInterval));
}
Also used : Mappings(com.b2international.index.mapping.Mappings) RemoteJobTracker(com.b2international.snowowl.core.jobs.RemoteJobTracker) Index(com.b2international.index.Index) RepositoryConfiguration(com.b2international.snowowl.core.config.RepositoryConfiguration) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) RemoteJobEntry(com.b2international.snowowl.core.jobs.RemoteJobEntry)

Example 17 with Index

use of com.b2international.index.Index in project snow-owl by b2ihealthcare.

the class SnomedReasonerPlugin method run.

@Override
public void run(final SnowOwlConfiguration configuration, final Environment env) throws Exception {
    if (env.isServer()) {
        final Index repositoryIndex = env.service(RepositoryManager.class).get(getToolingId()).service(Index.class);
        final SnomedCoreConfiguration snomedConfig = configuration.getModuleConfig(SnomedCoreConfiguration.class);
        final int maximumReasonerRuns = snomedConfig.getMaxReasonerRuns();
        // TODO: make this configurable
        final long cleanUpInterval = TimeUnit.MINUTES.toMillis(5L);
        final ClassificationTracker classificationTracker = new ClassificationTracker(repositoryIndex, maximumReasonerRuns, cleanUpInterval);
        env.services().registerService(ClassificationTracker.class, classificationTracker);
    }
}
Also used : SnomedCoreConfiguration(com.b2international.snowowl.snomed.datastore.config.SnomedCoreConfiguration) Index(com.b2international.index.Index) ClassificationTracker(com.b2international.snowowl.snomed.reasoner.classification.ClassificationTracker)

Aggregations

Index (com.b2international.index.Index)17 Mappings (com.b2international.index.mapping.Mappings)13 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)13 RepositoryConfiguration (com.b2international.snowowl.core.config.RepositoryConfiguration)6 Before (org.junit.Before)6 ValidationRepository (com.b2international.snowowl.core.internal.validation.ValidationRepository)4 ValidationRule (com.b2international.snowowl.core.validation.rule.ValidationRule)4 RevisionIndex (com.b2international.index.revision.RevisionIndex)3 ValidationIssue (com.b2international.snowowl.core.validation.issue.ValidationIssue)3 ValidationWhiteList (com.b2international.snowowl.core.validation.whitelist.ValidationWhiteList)3 ItemIdGenerationStrategy (com.b2international.snowowl.snomed.cis.gen.ItemIdGenerationStrategy)3 DefaultSnomedIdentifierService (com.b2international.snowowl.snomed.cis.memory.DefaultSnomedIdentifierService)3 DefaultRevisionIndex (com.b2international.index.revision.DefaultRevisionIndex)2 TimestampProvider (com.b2international.index.revision.TimestampProvider)2 ClassPathScanner (com.b2international.snowowl.core.plugin.ClassPathScanner)2 ValidationIssueDetailExtensionProvider (com.b2international.snowowl.core.validation.issue.ValidationIssueDetailExtensionProvider)2 ISnomedIdentifierService (com.b2international.snowowl.snomed.cis.ISnomedIdentifierService)2 SnomedIdentifierConfiguration (com.b2international.snowowl.snomed.cis.SnomedIdentifierConfiguration)2 SctId (com.b2international.snowowl.snomed.cis.domain.SctId)2 SequentialItemIdGenerationStrategy (com.b2international.snowowl.snomed.cis.gen.SequentialItemIdGenerationStrategy)2