Search in sources :

Example 1 with QueryIndexProvider

use of org.apache.jackrabbit.oak.spi.query.QueryIndexProvider in project jackrabbit-oak by apache.

the class Jcr method setUpOak.

private void setUpOak() {
    // whiteboard
    if (whiteboard != null) {
        oak.with(whiteboard);
    }
    // repository initializers
    for (RepositoryInitializer repositoryInitializer : repositoryInitializers) {
        oak.with(repositoryInitializer);
    }
    // query index providers
    for (QueryIndexProvider queryIndexProvider : queryIndexProviders) {
        oak.with(queryIndexProvider);
    }
    // commit hooks
    for (CommitHook commitHook : commitHooks) {
        oak.with(commitHook);
    }
    // conflict handlers
    oak.with(conflictHandler);
    // index editor providers
    for (IndexEditorProvider indexEditorProvider : indexEditorProviders) {
        oak.with(indexEditorProvider);
    }
    // editors
    for (Editor editor : editors) {
        oak.with(editor);
    }
    // editor providers
    for (EditorProvider editorProvider : editorProviders) {
        oak.with(editorProvider);
    }
    // securityProvider
    oak.with(securityProvider);
    // executors
    if (scheduledExecutor != null) {
        oak.with(scheduledExecutor);
    }
    if (executor != null) {
        oak.with(executor);
    }
    // observers
    for (Observer observer : observers) {
        oak.with(observer);
    }
    // commit rate limiter
    if (commitRateLimiter != null) {
        oak.with(commitRateLimiter);
    }
    // query engine settings
    if (queryEngineSettings != null) {
        oak.with(queryEngineSettings);
    }
    // default workspace name
    if (defaultWorkspaceName != null) {
        oak.with(defaultWorkspaceName);
    }
    if (clusterable != null) {
        oak.with(clusterable);
    }
}
Also used : CommitHook(org.apache.jackrabbit.oak.spi.commit.CommitHook) BackgroundObserver(org.apache.jackrabbit.oak.spi.commit.BackgroundObserver) Observer(org.apache.jackrabbit.oak.spi.commit.Observer) OrderedPropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexEditorProvider) PropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider) IndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider) RepositoryInitializer(org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer) Editor(org.apache.jackrabbit.oak.spi.commit.Editor) TypeEditorProvider(org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider) OrderedPropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexEditorProvider) PropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider) ReferenceEditorProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider) NodeCounterEditorProvider(org.apache.jackrabbit.oak.plugins.index.counter.NodeCounterEditorProvider) NamespaceEditorProvider(org.apache.jackrabbit.oak.plugins.name.NamespaceEditorProvider) EditorProvider(org.apache.jackrabbit.oak.spi.commit.EditorProvider) IndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider) QueryIndexProvider(org.apache.jackrabbit.oak.spi.query.QueryIndexProvider)

Example 2 with QueryIndexProvider

use of org.apache.jackrabbit.oak.spi.query.QueryIndexProvider in project jackrabbit-oak by apache.

the class LuceneIndexDescendantSuggestionTest method before.

@Before
public void before() throws Exception {
    LuceneIndexProvider provider = new LuceneIndexProvider();
    Jcr jcr = new Jcr().with(((QueryIndexProvider) provider)).with((Observer) provider).with(new LuceneIndexEditorProvider());
    repository = jcr.createRepository();
    session = (JackrabbitSession) repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
    root = session.getRootNode();
    createContent();
    session.save();
}
Also used : SimpleCredentials(javax.jcr.SimpleCredentials) Observer(org.apache.jackrabbit.oak.spi.commit.Observer) Jcr(org.apache.jackrabbit.oak.jcr.Jcr) QueryIndexProvider(org.apache.jackrabbit.oak.spi.query.QueryIndexProvider) Before(org.junit.Before)

Example 3 with QueryIndexProvider

use of org.apache.jackrabbit.oak.spi.query.QueryIndexProvider in project jackrabbit-oak by apache.

the class LuceneIndexDescendantSpellcheckTest method before.

@Before
public void before() throws Exception {
    LuceneIndexProvider provider = new LuceneIndexProvider();
    Jcr jcr = new Jcr().with(((QueryIndexProvider) provider)).with((Observer) provider).with(new LuceneIndexEditorProvider());
    repository = jcr.createRepository();
    session = (JackrabbitSession) repository.login(new SimpleCredentials("admin", "admin".toCharArray()));
    root = session.getRootNode();
    createContent();
    session.save();
}
Also used : SimpleCredentials(javax.jcr.SimpleCredentials) Observer(org.apache.jackrabbit.oak.spi.commit.Observer) Jcr(org.apache.jackrabbit.oak.jcr.Jcr) QueryIndexProvider(org.apache.jackrabbit.oak.spi.query.QueryIndexProvider) Before(org.junit.Before)

Example 4 with QueryIndexProvider

use of org.apache.jackrabbit.oak.spi.query.QueryIndexProvider 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();
}
Also used : MongoBlobStore(org.apache.jackrabbit.oak.plugins.document.mongo.MongoBlobStore) ActiveDeletedBlobCollectorImpl(org.apache.jackrabbit.oak.plugins.index.lucene.directory.ActiveDeletedBlobCollectorFactory.ActiveDeletedBlobCollectorImpl) AsyncIndexUpdate(org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate) OpenSecurityProvider(org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider) IndexCopier(org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier) QueryIndexProvider(org.apache.jackrabbit.oak.spi.query.QueryIndexProvider) ExtractedTextCache(org.apache.jackrabbit.oak.plugins.index.lucene.ExtractedTextCache) InitialContent(org.apache.jackrabbit.oak.InitialContent) LuceneIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider) Oak(org.apache.jackrabbit.oak.Oak) LuceneIndexProvider(org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider) File(java.io.File) FileDataStore(org.apache.jackrabbit.core.data.FileDataStore) DataStoreBlobStore(org.apache.jackrabbit.oak.plugins.blob.datastore.DataStoreBlobStore)

Example 5 with QueryIndexProvider

use of org.apache.jackrabbit.oak.spi.query.QueryIndexProvider in project jackrabbit-oak by apache.

the class SolrQueryIndexProviderService method activate.

@SuppressWarnings("UnusedDeclaration")
@Activate
protected void activate(ComponentContext componentContext) {
    Object value = componentContext.getProperties().get(QUERY_TIME_AGGREGATION);
    boolean queryTimeAggregation = PropertiesUtil.toBoolean(value, QUERY_TIME_AGGREGATION_DEFAULT);
    if (solrServerProvider != null && oakSolrConfigurationProvider != null) {
        QueryIndexProvider solrQueryIndexProvider = new SolrQueryIndexProvider(solrServerProvider, oakSolrConfigurationProvider, nodeAggregator);
        log.debug("creating Solr query index provider {} query time aggregation", queryTimeAggregation ? "with" : "without");
        if (queryTimeAggregation) {
            solrQueryIndexProvider = AggregateIndexProvider.wrap(solrQueryIndexProvider);
        }
        regs.add(componentContext.getBundleContext().registerService(QueryIndexProvider.class.getName(), solrQueryIndexProvider, null));
    }
}
Also used : SolrQueryIndexProvider(org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndexProvider) SolrQueryIndexProvider(org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndexProvider) QueryIndexProvider(org.apache.jackrabbit.oak.spi.query.QueryIndexProvider) Activate(org.apache.felix.scr.annotations.Activate)

Aggregations

QueryIndexProvider (org.apache.jackrabbit.oak.spi.query.QueryIndexProvider)13 Oak (org.apache.jackrabbit.oak.Oak)6 OpenSecurityProvider (org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider)6 Observer (org.apache.jackrabbit.oak.spi.commit.Observer)5 SimpleCredentials (javax.jcr.SimpleCredentials)4 InitialContent (org.apache.jackrabbit.oak.InitialContent)4 Jcr (org.apache.jackrabbit.oak.jcr.Jcr)3 LuceneIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorProvider)3 LuceneIndexProvider (org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProvider)3 PropertyIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider)3 Before (org.junit.Before)3 ContentRepository (org.apache.jackrabbit.oak.api.ContentRepository)2 AsyncIndexUpdate (org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate)2 IndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider)2 NodeTypeIndexProvider (org.apache.jackrabbit.oak.plugins.index.nodetype.NodeTypeIndexProvider)2 MemoryNodeStore (org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore)2 CommitHook (org.apache.jackrabbit.oak.spi.commit.CommitHook)2 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 File (java.io.File)1 IOException (java.io.IOException)1