Search in sources :

Example 6 with BackgroundObserver

use of org.apache.jackrabbit.oak.spi.commit.BackgroundObserver in project jackrabbit-oak by apache.

the class LuceneIndexProviderService method registerObserver.

private void registerObserver(BundleContext bundleContext, Map<String, ?> config) {
    boolean enableAsyncIndexOpen = PropertiesUtil.toBoolean(config.get(PROP_ASYNC_INDEX_OPEN), true);
    Observer observer = indexProvider;
    if (enableAsyncIndexOpen) {
        backgroundObserver = new BackgroundObserver(indexProvider, getExecutorService(), 5);
        observer = backgroundObserver;
        oakRegs.add(registerMBean(whiteboard, BackgroundObserverMBean.class, backgroundObserver.getMBean(), BackgroundObserverMBean.TYPE, "LuceneIndexConfigObserver queue stats"));
        log.info("Registering the LuceneIndexProvider as a BackgroundObserver");
    }
    regs.add(bundleContext.registerService(Observer.class.getName(), observer, null));
}
Also used : BackgroundObserver(org.apache.jackrabbit.oak.spi.commit.BackgroundObserver) Observer(org.apache.jackrabbit.oak.spi.commit.Observer) LocalIndexObserver(org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.LocalIndexObserver) BackgroundObserver(org.apache.jackrabbit.oak.spi.commit.BackgroundObserver) BackgroundObserverMBean(org.apache.jackrabbit.oak.spi.commit.BackgroundObserverMBean)

Aggregations

BackgroundObserver (org.apache.jackrabbit.oak.spi.commit.BackgroundObserver)6 BackgroundObserverMBean (org.apache.jackrabbit.oak.spi.commit.BackgroundObserverMBean)3 LocalIndexObserver (org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.LocalIndexObserver)2 Observer (org.apache.jackrabbit.oak.spi.commit.Observer)2 Hashtable (java.util.Hashtable)1 Activate (org.apache.felix.scr.annotations.Activate)1 OsgiWhiteboard (org.apache.jackrabbit.oak.osgi.OsgiWhiteboard)1 DocumentQueue (org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.DocumentQueue)1 ExternalObserverBuilder (org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.ExternalObserverBuilder)1 LuceneJournalPropertyService (org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.LuceneJournalPropertyService)1 Filter (org.apache.jackrabbit.oak.plugins.observation.Filter)1 FilteringDispatcher (org.apache.jackrabbit.oak.plugins.observation.FilteringDispatcher)1 FilteringObserver (org.apache.jackrabbit.oak.plugins.observation.FilteringObserver)1 ChangeSetFilter (org.apache.jackrabbit.oak.plugins.observation.filter.ChangeSetFilter)1 EventFilter (org.apache.jackrabbit.oak.plugins.observation.filter.EventFilter)1 CommitInfo (org.apache.jackrabbit.oak.spi.commit.CommitInfo)1 NodeState (org.apache.jackrabbit.oak.spi.state.NodeState)1 Whiteboard (org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard)1 WhiteboardExecutor (org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardExecutor)1 BundleContext (org.osgi.framework.BundleContext)1