test_class.declarator: folder = new TemporaryFolder(new File("target"))
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder folder = new TemporaryFolder(new File("target"));
test_class.type: TemporaryFolder
test_class.var_name: folder
test_class.declarator: root = INITIAL_CONTENT
test_class.modifier: private
test_class.original_string: private NodeState root = INITIAL_CONTENT;
test_class.type: NodeState
test_class.var_name: root
test_class.declarator: builder = EMPTY_NODE.builder()
test_class.modifier: private
test_class.original_string: private NodeBuilder builder = EMPTY_NODE.builder();
test_class.type: NodeBuilder
test_class.var_name: builder
test_class.declarator: defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo")
test_class.modifier: private
test_class.original_string: private LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo");
test_class.type: LuceneIndexDefinition
test_class.var_name: defn
test_class.declarator: mip = Mounts.newBuilder()
              .mount("foo", "/libs", "/apps")
              .readOnlyMount("ro", "/ro-tree")
              .build()
test_class.modifier: private
test_class.original_string: private MountInfoProvider mip = Mounts.newBuilder()
              .mount("foo", "/libs", "/apps")
              .readOnlyMount("ro", "/ro-tree")
              .build();
test_class.type: MountInfoProvider
test_class.var_name: mip
test_class.declarator: fooMount
test_class.modifier: private
test_class.original_string: private Mount fooMount;
test_class.type: Mount
test_class.var_name: fooMount
test_class.declarator: roMount
test_class.modifier: private
test_class.original_string: private Mount roMount;
test_class.type: Mount
test_class.var_name: roMount
test_class.declarator: defaultMount
test_class.modifier: private
test_class.original_string: private Mount defaultMount;
test_class.type: Mount
test_class.var_name: defaultMount
test_class.declarator: writerConfig = new LuceneIndexWriterConfig()
test_class.modifier: private
test_class.original_string: private LuceneIndexWriterConfig writerConfig = new LuceneIndexWriterConfig();
test_class.type: LuceneIndexWriterConfig
test_class.var_name: writerConfig
test_class.file: oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/writer/MultiplexingIndexWriterTest.java
test_class.identifier: MultiplexingIndexWriterTest
test_case.body: @Test
      public void closeWithoutChange() throws Exception{
          LuceneIndexWriterFactory factory = newDirectoryFactory();
          LuceneIndexWriter writer = factory.newInstance(defn, builder, null, true);
          assertTrue(writer.close(0));
          assertEquals(2, Iterables.size(getIndexDirNodes()));
          assertFalse(builder.hasChildNode(indexDirName(roMount)));
          assertEquals(0, numDocs(fooMount));
          assertEquals(0, numDocs(defaultMount));
  
          // delete all dir nodes first
          getIndexDirNodes().forEach(dirName -> builder.getChildNode(dirName).remove());
  
          // empty index dir doesn't get created during normal indexing
          writer = factory.newInstance(defn, builder, null, false);
          assertFalse(writer.close(0));
          assertEquals(0, Iterables.size(getIndexDirNodes()));
      }
test_case.class_method_signature: MultiplexingIndexWriterTest.closeWithoutChange()
test_case.full_signature: @Test public void closeWithoutChange()
test_case.identifier: closeWithoutChange
test_case.invocations: newDirectoryFactory newInstance assertTrue close assertEquals size getIndexDirNodes assertFalse hasChildNode indexDirName assertEquals numDocs assertEquals numDocs forEach getIndexDirNodes remove getChildNode newInstance assertFalse close assertEquals size getIndexDirNodes
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void closeWithoutChange()
focal_class.declarator: mountInfoProvider
focal_class.modifier: private final
focal_class.original_string: private final MountInfoProvider mountInfoProvider;
focal_class.type: MountInfoProvider
focal_class.var_name: mountInfoProvider
focal_class.declarator: directoryFactory
focal_class.modifier: private final
focal_class.original_string: private final DirectoryFactory directoryFactory;
focal_class.type: DirectoryFactory
focal_class.var_name: directoryFactory
focal_class.declarator: definition
focal_class.modifier: private final
focal_class.original_string: private final LuceneIndexDefinition definition;
focal_class.type: LuceneIndexDefinition
focal_class.var_name: definition
focal_class.declarator: definitionBuilder
focal_class.modifier: private final
focal_class.original_string: private final NodeBuilder definitionBuilder;
focal_class.type: NodeBuilder
focal_class.var_name: definitionBuilder
focal_class.declarator: reindex
focal_class.modifier: private final
focal_class.original_string: private final boolean reindex;
focal_class.type: boolean
focal_class.var_name: reindex
focal_class.declarator: writerConfig
focal_class.modifier: private final
focal_class.original_string: private final LuceneIndexWriterConfig writerConfig;
focal_class.type: LuceneIndexWriterConfig
focal_class.var_name: writerConfig
focal_class.declarator: writers = Maps.newHashMap()
focal_class.modifier: private final
focal_class.original_string: private final Map<Mount, DefaultIndexWriter> writers = Maps.newHashMap();
focal_class.type: Map<Mount, DefaultIndexWriter>
focal_class.var_name: writers
focal_class.file: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/writer/MultiplexingIndexWriter.java
focal_class.identifier: MultiplexingIndexWriter
focal_class.interfaces: implements LuceneIndexWriter
focal_class.class_method_signature: MultiplexingIndexWriter.MultiplexingIndexWriter(DirectoryFactory directoryFactory, MountInfoProvider mountInfoProvider,
                                     LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                                     boolean reindex, LuceneIndexWriterConfig writerConfig)
focal_class.full_signature: public  MultiplexingIndexWriter(DirectoryFactory directoryFactory, MountInfoProvider mountInfoProvider,
                                     LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                                     boolean reindex, LuceneIndexWriterConfig writerConfig)
focal_class.identifier: MultiplexingIndexWriter
focal_class.modifiers: public
focal_class.parameters: (DirectoryFactory directoryFactory, MountInfoProvider mountInfoProvider,
                                     LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                                     boolean reindex, LuceneIndexWriterConfig writerConfig)
focal_class.signature:  MultiplexingIndexWriter(DirectoryFactory directoryFactory, MountInfoProvider mountInfoProvider,
                                     LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                                     boolean reindex, LuceneIndexWriterConfig writerConfig)
focal_class.class_method_signature: MultiplexingIndexWriter.updateDocument(String path, Iterable<? extends IndexableField> doc)
focal_class.full_signature: @Override public void updateDocument(String path, Iterable<? extends IndexableField> doc)
focal_class.identifier: updateDocument
focal_class.modifiers: @Override public
focal_class.parameters: (String path, Iterable<? extends IndexableField> doc)
focal_class.return: void
focal_class.signature: void updateDocument(String path, Iterable<? extends IndexableField> doc)
focal_class.class_method_signature: MultiplexingIndexWriter.deleteDocuments(String path)
focal_class.full_signature: @Override public void deleteDocuments(String path)
focal_class.identifier: deleteDocuments
focal_class.modifiers: @Override public
focal_class.parameters: (String path)
focal_class.return: void
focal_class.signature: void deleteDocuments(String path)
focal_class.class_method_signature: MultiplexingIndexWriter.close(long timestamp)
focal_class.full_signature: @Override public boolean close(long timestamp)
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: (long timestamp)
focal_class.return: boolean
focal_class.signature: boolean close(long timestamp)
focal_class.class_method_signature: MultiplexingIndexWriter.getWriter(String path)
focal_class.full_signature: private LuceneIndexWriter getWriter(String path)
focal_class.identifier: getWriter
focal_class.modifiers: private
focal_class.parameters: (String path)
focal_class.return: LuceneIndexWriter
focal_class.signature: LuceneIndexWriter getWriter(String path)
focal_class.class_method_signature: MultiplexingIndexWriter.getWriter(Mount mount)
focal_class.full_signature: private DefaultIndexWriter getWriter(Mount mount)
focal_class.identifier: getWriter
focal_class.modifiers: private
focal_class.parameters: (Mount mount)
focal_class.return: DefaultIndexWriter
focal_class.signature: DefaultIndexWriter getWriter(Mount mount)
focal_class.class_method_signature: MultiplexingIndexWriter.createWriter(Mount m)
focal_class.full_signature: private DefaultIndexWriter createWriter(Mount m)
focal_class.identifier: createWriter
focal_class.modifiers: private
focal_class.parameters: (Mount m)
focal_class.return: DefaultIndexWriter
focal_class.signature: DefaultIndexWriter createWriter(Mount m)
focal_method.body: @Override
      public boolean close(long timestamp) throws IOException {
          // explicitly get writers for mounts which haven't got writers even at close.
          // This essentially ensures we respect DefaultIndexWriters#close's intent to
          // create empty index even if nothing has been written during re-index.
          stream(concat(singleton(mountInfoProvider.getDefaultMount()), mountInfoProvider.getNonDefaultMounts())
                  .spliterator(), false)
                  .filter(m ->  reindex && !m.isReadOnly()) // only needed when re-indexing for read-write mounts.
                                                           // reindex for ro-mount doesn't make sense in this case anyway.
                  .forEach(m -> getWriter(m)); // open default writers for mounts that passed all our tests
  
          boolean indexUpdated = false;
          for (LuceneIndexWriter w : writers.values()) {
              indexUpdated |= w.close(timestamp);
          }
          return indexUpdated;
      }
focal_method.class_method_signature: MultiplexingIndexWriter.close(long timestamp)
focal_method.full_signature: @Override public boolean close(long timestamp)
focal_method.identifier: close
focal_method.invocations: forEach filter stream spliterator concat singleton getDefaultMount getNonDefaultMounts isReadOnly getWriter values close
focal_method.modifiers: @Override public
focal_method.parameters: (long timestamp)
focal_method.return: boolean
focal_method.signature: boolean close(long timestamp)