IndexUpdate implements Editor, PathSource { static boolean isIncluded(String asyncRef, NodeBuilder definition) { if (definition.hasProperty(ASYNC_PROPERTY_NAME)) { PropertyState p = definition.getProperty(ASYNC_PROPERTY_NAME); Iterable<String> opt = p.getValue(Type.STRINGS); if (asyncRef == null) { return Iterables.contains(opt, INDEXING_MODE_NRT) || Iterables.contains(opt, INDEXING_MODE_SYNC); } else { return Iterables.contains(opt, asyncRef); } } else { return asyncRef == null; } } IndexUpdate(
            IndexEditorProvider provider, String async,
            NodeState root, NodeBuilder builder,
            IndexUpdateCallback updateCallback);  IndexUpdate(
            IndexEditorProvider provider, String async,
            NodeState root, NodeBuilder builder,
            IndexUpdateCallback updateCallback, CommitInfo commitInfo);  IndexUpdate(
            IndexEditorProvider provider, String async,
            NodeState root, NodeBuilder builder,
            IndexUpdateCallback updateCallback, NodeTraversalCallback traversalCallback,
            CommitInfo commitInfo, CorruptIndexHandler corruptIndexHandler); private  IndexUpdate(IndexUpdate parent, String name); @Override void enter(NodeState before, NodeState after); boolean isReindexingPerformed(); List<String> getReindexStats(); Set<String> getUpdatedIndexPaths(); void setTraversalRateEstimator(TraversalRateEstimator estimator); void setNodeCountEstimator(NodeCountEstimator nodeCountEstimator); String getIndexingStats(); void setIgnoreReindexFlags(boolean ignoreReindexFlag); @Override String getPath(); @Override void leave(NodeState before, NodeState after); @Override void propertyAdded(PropertyState after); @Override void propertyChanged(PropertyState before, PropertyState after); @Override void propertyDeleted(PropertyState before); @Override @NotNull Editor childNodeAdded(String name, NodeState after); @Override @NotNull Editor childNodeChanged(
            String name, NodeState before, NodeState after); @Override @Nullable Editor childNodeDeleted(String name, NodeState before); void commitProgress(IndexProgress indexProgress); IndexUpdate withMissingProviderStrategy(
            MissingIndexProviderStrategy missingProvider);  }
@Test public void testAsyncMVPDefinition() throws Exception { NodeBuilder base; base = EmptyNodeState.EMPTY_NODE.builder(); assertTrue(IndexUpdate.isIncluded(null, base)); assertFalse(IndexUpdate.isIncluded("async", base)); base = EmptyNodeState.EMPTY_NODE.builder().setProperty( ASYNC_PROPERTY_NAME, "async"); assertFalse(IndexUpdate.isIncluded(null, base)); assertTrue(IndexUpdate.isIncluded("async", base)); base = EmptyNodeState.EMPTY_NODE.builder() .setProperty(ASYNC_PROPERTY_NAME, Sets.newHashSet(INDEXING_MODE_NRT, "async"), Type.STRINGS); assertTrue(IndexUpdate.isIncluded(null, base)); assertTrue(IndexUpdate.isIncluded("async", base)); assertFalse(IndexUpdate.isIncluded("async-other", base)); base = EmptyNodeState.EMPTY_NODE.builder().setProperty( ASYNC_PROPERTY_NAME, Sets.newHashSet("sync", "async"), Type.STRINGS); assertTrue(IndexUpdate.isIncluded(null, base)); assertTrue(IndexUpdate.isIncluded("async", base)); assertFalse(IndexUpdate.isIncluded("async-other", base)); base = EmptyNodeState.EMPTY_NODE.builder().setProperty( ASYNC_PROPERTY_NAME, Sets.newHashSet("async", "async-other"), Type.STRINGS); assertFalse(IndexUpdate.isIncluded(null, base)); assertTrue(IndexUpdate.isIncluded("async", base)); assertTrue(IndexUpdate.isIncluded("async-other", base)); }