use of org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndexFactory in project jackrabbit-oak by apache.
the class HybridIndexTest method prepareLuceneIndexer.
private void prepareLuceneIndexer(File workDir) {
try {
indexCopierDir = createTemporaryFolderIn(workDir);
copier = new IndexCopier(executorService, indexCopierDir, true);
} catch (IOException e) {
throw new RuntimeException(e);
}
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);
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndexFactory in project jackrabbit-oak by apache.
the class LuceneIndexProviderService method createTracker.
private IndexTracker createTracker(BundleContext bundleContext, Map<String, ?> config) throws IOException {
boolean enableCopyOnRead = PropertiesUtil.toBoolean(config.get(PROP_COPY_ON_READ), true);
if (enableCopyOnRead) {
initializeIndexCopier(bundleContext, config);
log.info("Enabling CopyOnRead support. Index files would be copied under {}", indexDir.getAbsolutePath());
if (hybridIndex) {
nrtIndexFactory = new NRTIndexFactory(indexCopier, statisticsProvider);
}
return new IndexTracker(new DefaultIndexReaderFactory(mountInfoProvider, indexCopier), nrtIndexFactory);
}
return new IndexTracker();
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndexFactory in project jackrabbit-oak by apache.
the class IndexNodeTest method setUp.
@Before
public void setUp() throws IOException {
indexCopier = new IndexCopier(sameThreadExecutor(), temporaryFolder.getRoot());
nrtFactory = new NRTIndexFactory(indexCopier, StatisticsProvider.NOOP);
readerFactory = new DefaultIndexReaderFactory(Mounts.defaultMountInfoProvider(), indexCopier);
LuceneIndexEditorContext.configureUniqueId(builder);
}
Aggregations