use of org.apache.jackrabbit.oak.plugins.index.counter.NodeCounterEditorProvider in project jackrabbit-oak by apache.
the class ReIndexer method createIndexEditorProvider.
private IndexEditorProvider createIndexEditorProvider() throws IOException {
//Need to list all used editors otherwise async index run fails with
//MissingIndexEditor exception. Better approach would be to change lane for
//those indexes and then do reindexing
NodeCounterEditorProvider counter = new NodeCounterEditorProvider();
IndexEditorProvider lucene = indexHelper.getLuceneIndexHelper().createEditorProvider();
IndexEditorProvider property = new PropertyIndexEditorProvider().with(indexHelper.getMountInfoProvider());
return CompositeIndexEditorProvider.compose(asList(lucene, property, counter));
}
use of org.apache.jackrabbit.oak.plugins.index.counter.NodeCounterEditorProvider in project jackrabbit-oak by apache.
the class TraversalAvoidanceTest method createRepository.
@Override
protected ContentRepository createRepository() {
nodeStore = new MemoryNodeStore();
Oak oak = new Oak(nodeStore).with(new OpenSecurityProvider()).with(new InitialContent()).with(new NodeCounterEditorProvider()).with(testIndexProvider).withAsyncIndexing("async", TimeUnit.DAYS.toSeconds(1));
wb = oak.getWhiteboard();
return oak.createContentRepository();
}
use of org.apache.jackrabbit.oak.plugins.index.counter.NodeCounterEditorProvider in project jackrabbit-oak by apache.
the class SynchronousPropertyIndexTest method createRepository.
@Override
protected ContentRepository createRepository() {
IndexCopier copier;
try {
copier = new IndexCopier(executorService, temporaryFolder.getRoot());
} catch (IOException e) {
throw new RuntimeException(e);
}
nrtIndexFactory = new NRTIndexFactory(copier, Clock.SIMPLE, 1000, StatisticsProvider.NOOP);
MountInfoProvider mip = defaultMountInfoProvider();
LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier);
IndexTracker tracker = new IndexTracker(indexReaderFactory, nrtIndexFactory);
luceneIndexProvider = new LuceneIndexProvider(tracker);
LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, tracker, null, null, Mounts.defaultMountInfoProvider());
editorProvider.setIndexingQueue(queue);
Oak oak = new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with((QueryIndexProvider) luceneIndexProvider).with((Observer) luceneIndexProvider).with(editorProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).with(new NodeCounterEditorProvider()).with(delayingEditorProvider).with(optionalEditorProvider).withAsyncIndexing("async", TimeUnit.DAYS.toSeconds(1));
wb = oak.getWhiteboard();
return oak.createContentRepository();
}
use of org.apache.jackrabbit.oak.plugins.index.counter.NodeCounterEditorProvider in project jackrabbit-oak by apache.
the class HybridIndexTest method createRepository.
@Override
protected ContentRepository createRepository() {
IndexCopier copier;
try {
copier = new IndexCopier(executorService, temporaryFolder.getRoot());
} catch (IOException e) {
throw new RuntimeException(e);
}
MountInfoProvider mip = defaultMountInfoProvider();
nrtIndexFactory = new NRTIndexFactory(copier, clock, TimeUnit.MILLISECONDS.toSeconds(refreshDelta), StatisticsProvider.NOOP);
nrtIndexFactory.setAssertAllResourcesClosed(true);
LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier);
IndexTracker tracker = new IndexTracker(indexReaderFactory, nrtIndexFactory);
luceneIndexProvider = new LuceneIndexProvider(tracker);
queue = new DocumentQueue(100, tracker, sameThreadExecutor());
LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, tracker, null, null, mip);
editorProvider.setIndexingQueue(queue);
LocalIndexObserver localIndexObserver = new LocalIndexObserver(queue, StatisticsProvider.NOOP);
nodeStore = new MemoryNodeStore();
Oak oak = new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with((QueryIndexProvider) luceneIndexProvider).with((Observer) luceneIndexProvider).with(localIndexObserver).with(editorProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).with(optionalEditorProvider).with(new NodeCounterEditorProvider()).withAsyncIndexing("async", TimeUnit.DAYS.toSeconds(1));
wb = oak.getWhiteboard();
return oak.createContentRepository();
}
Aggregations