@Override public Iterable<String> getIndexPaths() { NodeState nodeType = NodeStateUtils.getNode(nodeStore.getRoot(), "/oak:index/nodetype"); checkState("property".equals(nodeType.getString("type")), "nodetype index at " + "/oak:index/nodetype is found to be disabled. Cannot determine the paths of all indexes"); //Check if oak:QueryIndexDefinition is indexed as part of nodetype index boolean indxDefnTypeIndexed = Iterables.contains(nodeType.getNames(DECLARING_NODE_TYPES), INDEX_DEFINITIONS_NODE_TYPE); if (!indxDefnTypeIndexed) { log.warn("{} is not found to be indexed as part of nodetype index. Non root indexes would " + "not be listed", INDEX_DEFINITIONS_NODE_TYPE); NodeState oakIndex = nodeStore.getRoot().getChildNode("oak:index"); return transform(filter(oakIndex.getChildNodeEntries(), cne -> INDEX_DEFINITIONS_NODE_TYPE.equals(cne.getNodeState().getName(JCR_PRIMARYTYPE))), cne -> PathUtils.concat("/oak:index", cne.getName())); } return () -> { Iterator<IndexRow> itr = getIndex().query(createFilter(INDEX_DEFINITIONS_NODE_TYPE), nodeStore.getRoot()); return transform(itr, input -> input.getPath()); }; }
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, null, //extractedTextCache null, //augmentorFactory 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)); }
assertThat(explain, containsString("/oak:index/barIndex")); IndexPathService idxPathService = new IndexPathServiceImpl(fixture2.getNodeStore()); List<String> indexPaths = Lists.newArrayList(idxPathService.getIndexPaths());
@Override public Iterable<String> getIndexPaths() { NodeState nodeType = NodeStateUtils.getNode(nodeStore.getRoot(), "/oak:index/nodetype"); checkState("property".equals(nodeType.getString("type")), "nodetype index at " + "/oak:index/nodetype is found to be disabled. Cannot determine the paths of all indexes"); //Check if oak:QueryIndexDefinition is indexed as part of nodetype index boolean indxDefnTypeIndexed = Iterables.contains(nodeType.getNames(DECLARING_NODE_TYPES), INDEX_DEFINITIONS_NODE_TYPE); if (!indxDefnTypeIndexed) { log.warn("{} is not found to be indexed as part of nodetype index. Non root indexes would " + "not be listed", INDEX_DEFINITIONS_NODE_TYPE); NodeState oakIndex = nodeStore.getRoot().getChildNode("oak:index"); return transform(filter(oakIndex.getChildNodeEntries(), cne -> INDEX_DEFINITIONS_NODE_TYPE.equals(cne.getNodeState().getName(JCR_PRIMARYTYPE))), cne -> PathUtils.concat("/oak:index", cne.getName())); } return () -> { Iterator<IndexRow> itr = getIndex().query(createFilter(INDEX_DEFINITIONS_NODE_TYPE), nodeStore.getRoot()); return transform(itr, input -> input.getPath()); }; }
IndexPathService indexPathService = new IndexPathServiceImpl(dns1); AsyncIndexInfoService asyncIndexInfoService = MockRegistrar.getAsyncIndexInfoService(newArrayList( new IndexMBeanInfoSupplier("foo-async", () -> STATUS_DONE, () -> 2L)
@Override public Iterable<String> getIndexPaths() { NodeState nodeType = NodeStateUtils.getNode(nodeStore.getRoot(), "/oak:index/nodetype"); checkState("property".equals(nodeType.getString("type")), "nodetype index at " + "/oak:index/nodetype is found to be disabled. Cannot determine the paths of all indexes"); //Check if oak:QueryIndexDefinition is indexed as part of nodetype index boolean indxDefnTypeIndexed = Iterables.contains(nodeType.getNames(DECLARING_NODE_TYPES), INDEX_DEFINITIONS_NODE_TYPE); if (!indxDefnTypeIndexed) { log.warn("{} is not found to be indexed as part of nodetype index. Non root indexes would " + "not be listed", INDEX_DEFINITIONS_NODE_TYPE); NodeState oakIndex = nodeStore.getRoot().getChildNode("oak:index"); return transform(filter(oakIndex.getChildNodeEntries(), cne -> INDEX_DEFINITIONS_NODE_TYPE.equals(cne.getNodeState().getName(JCR_PRIMARYTYPE))), cne -> PathUtils.concat("/oak:index", cne.getName())); } return () -> { Iterator<IndexRow> itr = getIndex().query(createFilter(INDEX_DEFINITIONS_NODE_TYPE), nodeStore.getRoot()); return transform(itr, input -> input.getPath()); }; }