use of org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider in project jackrabbit-oak by apache.
the class ReIndexer method createIndexEditorProvider.
private IndexEditorProvider createIndexEditorProvider() throws IOException {
//Need to list all used editors otherwise async index run fails with
//MissingIndexEditor exception. Better approach would be to change lane for
//those indexes and then do reindexing
NodeCounterEditorProvider counter = new NodeCounterEditorProvider();
IndexEditorProvider lucene = indexHelper.getLuceneIndexHelper().createEditorProvider();
IndexEditorProvider property = new PropertyIndexEditorProvider().with(indexHelper.getMountInfoProvider());
return CompositeIndexEditorProvider.compose(asList(lucene, property, counter));
}
use of org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider in project jackrabbit-oak by apache.
the class CrossMountReferenceValidatorTest method initializeHook.
@Before
public void initializeHook() {
MountInfoProvider mip = Mounts.newBuilder().mount("foo", "/a").build();
hook = new EditorHook(new CompositeEditorProvider(new IndexUpdateProvider(new CompositeIndexEditorProvider(new PropertyIndexEditorProvider().with(mip), new ReferenceEditorProvider().with(mip))), new CrossMountReferenceValidatorProvider().with(mip).withFailOnDetection(true)));
}
use of org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider in project jackrabbit-oak by apache.
the class AsyncIndexUpdateClusterTestIT method createAsync.
private static AsyncIndexUpdate createAsync(DocumentNodeStore ns, final IndexStatusListener l) {
IndexEditorProvider p = new TestEditorProvider(new PropertyIndexEditorProvider(), l);
AsyncIndexUpdate aiu = new AsyncIndexUpdate("async", ns, p) {
protected boolean updateIndex(NodeState before, String beforeCheckpoint, NodeState after, String afterCheckpoint, String afterTime, AsyncUpdateCallback callback) throws CommitFailedException {
if (MISSING_NODE == before) {
l.reindexing();
}
return super.updateIndex(before, beforeCheckpoint, after, afterCheckpoint, afterTime, callback);
}
};
aiu.setCloseTimeOut(1);
return aiu;
}
use of org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider in project jackrabbit-oak by apache.
the class MultiplexingLucenePropertyIndexTest method createRepository.
@Override
protected ContentRepository createRepository() {
IndexCopier copier = null;
try {
copier = new IndexCopier(executorService, temporaryFolder.getRoot());
} catch (IOException e) {
throw new RuntimeException(e);
}
LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, new ExtractedTextCache(10 * FileUtils.ONE_MB, 100), null, mip);
LuceneIndexProvider provider = new LuceneIndexProvider(new IndexTracker(new DefaultIndexReaderFactory(mip, copier)));
nodeStore = new MemoryNodeStore();
return new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with((QueryIndexProvider) provider).with((Observer) provider).with(editorProvider).with(new PropertyIndexEditorProvider()).with(new NodeTypeIndexProvider()).createContentRepository();
}
use of org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider in project jackrabbit-oak by apache.
the class UserInitializerTest method testAnonymousConfiguration.
/**
* @since OAK 1.0 The anonymous user is optional.
*/
@Test
public void testAnonymousConfiguration() throws Exception {
Map<String, Object> userParams = new HashMap();
userParams.put(UserConstants.PARAM_ANONYMOUS_ID, "");
ConfigurationParameters params = ConfigurationParameters.of(UserConfiguration.NAME, ConfigurationParameters.of(userParams));
SecurityProvider sp = new SecurityProviderImpl(params);
final ContentRepository repo = new Oak().with(new InitialContent()).with(new PropertyIndexEditorProvider()).with(new PropertyIndexProvider()).with(new TypeEditorProvider()).with(sp).createContentRepository();
ContentSession cs = Subject.doAs(SystemSubject.INSTANCE, new PrivilegedExceptionAction<ContentSession>() {
@Override
public ContentSession run() throws Exception {
return repo.login(null, null);
}
});
try {
Root root = cs.getLatestRoot();
UserConfiguration uc = sp.getConfiguration(UserConfiguration.class);
UserManager umgr = uc.getUserManager(root, NamePathMapper.DEFAULT);
Authorizable anonymous = umgr.getAuthorizable(UserConstants.DEFAULT_ANONYMOUS_ID);
assertNull(anonymous);
} finally {
cs.close();
}
// login as admin should fail
ContentSession anonymousSession = null;
try {
anonymousSession = repo.login(new GuestCredentials(), null);
fail();
} catch (LoginException e) {
//success
} finally {
if (anonymousSession != null) {
anonymousSession.close();
}
}
}
Aggregations