use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider in project jackrabbit-oak by apache.
the class ActiveDeletedBlobCollectionIT method createRepository.
@Override
protected ContentRepository createRepository() {
adbc = new ActiveDeletedBlobCollectorImpl(clock, new File(blobCollectionRoot.getRoot(), "deleted-blobs"), executorService);
IndexCopier copier = createIndexCopier();
editorProvider = new LuceneIndexEditorProvider(copier, null, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100), null, Mounts.defaultMountInfoProvider(), adbc);
provider = new LuceneIndexProvider(copier);
mongoConnection = connectionFactory.getConnection();
MongoUtils.dropCollections(mongoConnection.getDB());
if (dataStoreType == DataStoreType.WITHOUT_FDS) {
MongoBlobStore blobStore = new MongoBlobStore(mongoConnection.getDB());
blobStore.setBlockSize(128);
blobStore.setBlockSizeMin(48);
this.blobStore = new CountingBlobStore(blobStore);
} else {
FileDataStore fds = new FileDataStore();
fds.init(fileDataStoreRoot.getRoot().getAbsolutePath());
DataStoreBlobStore dsbs = new DataStoreBlobStore(fds);
dsbs.setBlockSize(128);
this.blobStore = new CountingBlobStore(dsbs);
}
nodeStore = new DocumentMK.Builder().setMongoDB(mongoConnection.getDB()).setBlobStore(this.blobStore).getNodeStore();
asyncIndexUpdate = new AsyncIndexUpdate("async", nodeStore, editorProvider);
return new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with((QueryIndexProvider) provider).with((Observer) provider).with(editorProvider).createContentRepository();
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider in project jackrabbit-oak by apache.
the class HybridIndexClusterIT method customize.
@Override
protected Jcr customize(Jcr jcr) {
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);
DocumentQueue 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);
ExternalIndexObserver externalIndexObserver = new ExternalIndexObserver(queue, tracker, StatisticsProvider.NOOP);
QueryEngineSettings qs = new QueryEngineSettings();
qs.setFailTraversal(true);
jcr.with((QueryIndexProvider) provider).with((Observer) provider).with(localIndexObserver).with(externalIndexObserver).with(editorProvider).with(qs).withAsyncIndexing("async", TimeUnit.DAYS.toSeconds(1));
return jcr;
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider in project jackrabbit-oak by apache.
the class DocumentQueueTest method setUp.
@Before
public void setUp() throws IOException {
IndexEditorProvider editorProvider = new LuceneIndexEditorProvider(null, null, null, defaultMountInfoProvider());
syncHook = new EditorHook(new IndexUpdateProvider(editorProvider));
asyncHook = new EditorHook(new IndexUpdateProvider(editorProvider, "async", false));
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider in project jackrabbit-oak by apache.
the class RepositoryFixture method configureLuceneProvider.
private void configureLuceneProvider(Oak oak) throws IOException {
LuceneIndexEditorProvider ep = new LuceneIndexEditorProvider();
LuceneIndexProvider provider = new LuceneIndexProvider();
oak.with((QueryIndexProvider) provider).with((Observer) provider).with(ep);
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider 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);
}
Aggregations