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);
}
}
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();
}
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();
}
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();
}
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));
}
}
Aggregations