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));
}
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);
}
}
Aggregations