use of org.apache.jackrabbit.oak.plugins.index.lucene.reader.LuceneIndexReaderFactory in project jackrabbit-oak by apache.
the class HybridIndexTest method prepareLuceneIndexer.
private void prepareLuceneIndexer(File workDir, NodeStore nodeStore) {
try {
indexCopierDir = createTemporaryFolderIn(workDir);
copier = new IndexCopier(executorService, indexCopierDir, true);
} catch (IOException e) {
throw new RuntimeException(e);
}
IndexPathService indexPathService = new IndexPathServiceImpl(nodeStore);
AsyncIndexInfoService asyncIndexInfoService = new AsyncIndexInfoServiceImpl(nodeStore);
nrtIndexFactory = new NRTIndexFactory(copier, Clock.SIMPLE, TimeUnit.MILLISECONDS.toSeconds(refreshDeltaMillis), StatisticsProvider.NOOP);
MountInfoProvider mip = Mounts.defaultMountInfoProvider();
LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier);
IndexTracker tracker = new IndexTracker(indexReaderFactory, nrtIndexFactory);
luceneIndexProvider = new LuceneIndexProvider(tracker);
luceneEditorProvider = new LuceneIndexEditorProvider(copier, tracker, // extractedTextCache
null, // augmentorFactory
null, mip);
queue = new DocumentQueue(queueSize, tracker, executorService, statsProvider);
localIndexObserver = new LocalIndexObserver(queue, statsProvider);
luceneEditorProvider.setIndexingQueue(queue);
if (syncIndexing) {
PropertyIndexCleaner cleaner = new PropertyIndexCleaner(nodeStore, indexPathService, asyncIndexInfoService, statsProvider);
regs.add(scheduleWithFixedDelay(whiteboard, cleaner, cleanerIntervalInSecs, true, true));
}
Thread.setDefaultUncaughtExceptionHandler((t, e) -> log.warn("Uncaught exception", e));
}
Aggregations