use of org.apache.jackrabbit.oak.plugins.index.lucene.property.PropertyIndexCleaner in project jackrabbit-oak by apache.
the class LuceneIndexProviderService method registerPropertyIndexCleaner.
private void registerPropertyIndexCleaner(Map<String, ?> config, BundleContext bundleContext) {
int cleanerInterval = PropertiesUtil.toInteger(config.get(PROP_INDEX_CLEANER_INTERVAL), PROP_INDEX_CLEANER_INTERVAL_DEFAULT);
if (cleanerInterval <= 0) {
log.info("Property index cleaner would not be registered");
return;
}
cleaner = new PropertyIndexCleaner(nodeStore, indexPathService, asyncIndexInfoService, statisticsProvider);
// Proxy check for DocumentNodeStore
if (nodeStore instanceof Clusterable) {
cleaner.setRecursiveDelete(true);
log.info("PropertyIndexCleaner configured to perform recursive delete");
}
oakRegs.add(scheduleWithFixedDelay(whiteboard, cleaner, ImmutableMap.of("scheduler.name", PropertyIndexCleaner.class.getName()), cleanerInterval, true, true));
log.info("Property index cleaner configured to run every [{}] seconds", cleanerInterval);
}
use of org.apache.jackrabbit.oak.plugins.index.lucene.property.PropertyIndexCleaner 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