@Test public void update() throws Exception{ NodeBuilder index = builder.child(INDEX_DEFINITIONS_NAME); newLucenePropertyIndexDefinition(index, "lucene", ImmutableSet.of("foo"), "async"); NodeState before = builder.getNodeState(); builder.setProperty("foo", "bar"); NodeState after = builder.getNodeState(); NodeState indexed = hook.processCommit(before, after, CommitInfo.EMPTY); assertEquals(0, tracker.getIndexNodePaths().size()); tracker.update(indexed); LuceneIndexNode indexNode = tracker.acquireIndexNode("/oak:index/lucene"); indexNode.release(); assertEquals(1, tracker.getIndexNodePaths().size()); tracker.refresh(); assertEquals(1, tracker.getIndexNodePaths().size()); tracker.update(indexed); assertEquals(0, tracker.getIndexNodePaths().size()); }
public synchronized void update(final NodeState root) { if (refresh) { this.root = root; close(); refresh = false; log.info("Refreshed the opened indexes"); } else { diffAndUpdate(root); } }
IndexTracker { public synchronized void update(final NodeState root) { if (refresh) { this.root = root; close(); refresh = false; log.info("Refreshed the opened indexes"); } else { diffAndUpdate(root); } } }
IndexTracker { public synchronized void update(final NodeState root) { if (refresh) { this.root = root; close(); refresh = false; log.info("Refreshed the opened indexes"); } else { diffAndUpdate(root); } } IndexTracker();  IndexTracker(IndexCopier cloner);  IndexTracker(LuceneIndexReaderFactory readerFactory);  IndexTracker(LuceneIndexReaderFactory readerFactory, @Nullable NRTIndexFactory nrtFactory); }
IndexTracker { public synchronized void update(final NodeState root) { if (refresh) { this.root = root; close(); refresh = false; log.info("Refreshed the opened indexes"); } else { diffAndUpdate(root); } } IndexTracker();  IndexTracker(IndexCopier cloner);  IndexTracker(LuceneIndexReaderFactory readerFactory);  IndexTracker(LuceneIndexReaderFactory readerFactory, @Nullable NRTIndexFactory nrtFactory); MountInfoProvider getMountInfoProvider(); synchronized void close(); synchronized void update(final NodeState root); void setAsyncIndexInfoService(AsyncIndexInfoService asyncIndexInfoService); AsyncIndexInfoService getAsyncIndexInfoService(); void refresh(); @Nullable LuceneIndexNode acquireIndexNode(String path); @Nullable LuceneIndexDefinition getIndexDefinition(String indexPath); Set<String> getIndexNodePaths(); BadIndexTracker getBadIndexTracker(); NodeState getRoot(); }
IndexTracker { public synchronized void update(final NodeState root) { if (refresh) { this.root = root; close(); refresh = false; log.info("Refreshed the opened indexes"); } else { diffAndUpdate(root); } } IndexTracker();  IndexTracker(IndexCopier cloner);  IndexTracker(LuceneIndexReaderFactory readerFactory);  IndexTracker(LuceneIndexReaderFactory readerFactory, @Nullable NRTIndexFactory nrtFactory); MountInfoProvider getMountInfoProvider(); synchronized void close(); synchronized void update(final NodeState root); void setAsyncIndexInfoService(AsyncIndexInfoService asyncIndexInfoService); AsyncIndexInfoService getAsyncIndexInfoService(); void refresh(); @Nullable LuceneIndexNode acquireIndexNode(String path); @Nullable LuceneIndexDefinition getIndexDefinition(String indexPath); Set<String> getIndexNodePaths(); BadIndexTracker getBadIndexTracker(); NodeState getRoot();  }