use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider in project jackrabbit-oak by apache.
the class AtomicCounterIT method setup.
@Before
public void setup() throws Exception {
DocumentNodeStore ns = builderProvider.newBuilder().getNodeStore();
NodeBuilder builder = ns.getRoot().builder();
NodeBuilder index = builder.child(INDEX_DEFINITIONS_NAME);
NodeBuilder lucene = newLuceneIndexDefinition(index, "lucene", ImmutableSet.of("String"), null, "async");
lucene.setProperty("async", of("async", "nrt"), STRINGS);
IndexDefinition.updateDefinition(index.child("lucene"));
ns.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider();
editorProvider.setIndexingQueue(mock(DocumentQueue.class));
LuceneIndexProvider provider = new LuceneIndexProvider();
ContentRepository repository = new Oak(ns).with(// Clusterable
ns).with(new OpenSecurityProvider()).with((QueryIndexProvider) provider).with((Observer) provider).with(editorProvider).with(executorService).withAtomicCounter().withAsyncIndexing("async", 1).withFailOnMissingIndexProvider().createContentRepository();
session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()), null);
while (isReindexing(session)) {
Thread.sleep(100);
}
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider in project jackrabbit-oak by apache.
the class LuceneOakRepositoryStub method preCreateRepository.
@Override
protected void preCreateRepository(Jcr jcr) {
LuceneIndexProvider provider = new LuceneIndexProvider().with(getNodeAggregator());
jcr.with(new LuceneCompatModeInitializer("luceneGlobal", (Set<String>) null)).with((QueryIndexProvider) provider).with((Observer) provider).withFastQueryResultSize(true).with(new LuceneIndexEditorProvider());
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider in project jackrabbit-oak by apache.
the class JsonIndexCommand method createLuceneIndexEditorProvider.
private static LuceneIndexEditorProvider createLuceneIndexEditorProvider() {
LuceneIndexEditorProvider ep = new LuceneIndexEditorProvider();
ScheduledExecutorService executorService = MoreExecutors.getExitingScheduledExecutorService((ScheduledThreadPoolExecutor) Executors.newScheduledThreadPool(5));
StatisticsProvider statsProvider = StatisticsProvider.NOOP;
int queueSize = Integer.getInteger("queueSize", 1000);
IndexTracker tracker = new IndexTracker();
DocumentQueue queue = new DocumentQueue(queueSize, tracker, executorService, statsProvider);
ep.setIndexingQueue(queue);
return ep;
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider in project jackrabbit-oak by apache.
the class MultiSessionQueryTest method before.
@Before
public void before() {
Jcr jcr = new Jcr();
// lucene specific
jcr.with(new LuceneInitializerHelper("lucene").async());
LuceneIndexProvider provider = new LuceneIndexProvider();
jcr.with((QueryIndexProvider) provider);
jcr.with((Observer) provider);
jcr.with(new LuceneIndexEditorProvider());
repository = jcr.createRepository();
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider 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 nrtIndexFactory = new NRTIndexFactory(copier, clock, TimeUnit.MILLISECONDS.toSeconds(refreshDelta), StatisticsProvider.NOOP);
LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier);
IndexTracker tracker = new IndexTracker(indexReaderFactory, nrtIndexFactory);
LuceneIndexProvider provider = 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) provider).with((Observer) provider).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