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: 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/DefaultIndexWriterTest.java
test_class.identifier: DefaultIndexWriterTest
test_case.body: @Test
      public void writeInitializedUponReindex() throws Exception {
          LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo");
          DefaultIndexWriter writer = createWriter(defn, true);
          assertTrue(writer.close(0));
      }
test_case.class_method_signature: DefaultIndexWriterTest.writeInitializedUponReindex()
test_case.full_signature: @Test public void writeInitializedUponReindex()
test_case.identifier: writeInitializedUponReindex
test_case.invocations: getNodeState createWriter assertTrue close
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void writeInitializedUponReindex()
focal_class.declarator: log = LoggerFactory.getLogger(DefaultIndexWriter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(DefaultIndexWriter.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: PERF_LOGGER =
              new PerfLogger(LoggerFactory.getLogger(LuceneIndexWriter.class.getName() + ".perf"))
focal_class.modifier: private static final
focal_class.original_string: private static final PerfLogger PERF_LOGGER =
              new PerfLogger(LoggerFactory.getLogger(LuceneIndexWriter.class.getName() + ".perf"));
focal_class.type: PerfLogger
focal_class.var_name: PERF_LOGGER
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: 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: dirName
focal_class.modifier: private final
focal_class.original_string: private final String dirName;
focal_class.type: String
focal_class.var_name: dirName
focal_class.declarator: suggestDirName
focal_class.modifier: private final
focal_class.original_string: private final String suggestDirName;
focal_class.type: String
focal_class.var_name: suggestDirName
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: writer
focal_class.modifier: private
focal_class.original_string: private IndexWriter writer;
focal_class.type: IndexWriter
focal_class.var_name: writer
focal_class.declarator: directory
focal_class.modifier: private
focal_class.original_string: private Directory directory;
focal_class.type: Directory
focal_class.var_name: directory
focal_class.declarator: genAtStart = -1
focal_class.modifier: private
focal_class.original_string: private long genAtStart = -1;
focal_class.type: long
focal_class.var_name: genAtStart
focal_class.declarator: indexUpdated = false
focal_class.modifier: private
focal_class.original_string: private boolean indexUpdated = false;
focal_class.type: boolean
focal_class.var_name: indexUpdated
focal_class.file: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/writer/DefaultIndexWriter.java
focal_class.identifier: DefaultIndexWriter
focal_class.interfaces: implements LuceneIndexWriter
focal_class.class_method_signature: DefaultIndexWriter.DefaultIndexWriter(LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                                DirectoryFactory directoryFactory, String dirName, String suggestDirName,
                                boolean reindex, LuceneIndexWriterConfig writerConfig)
focal_class.full_signature: public  DefaultIndexWriter(LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                                DirectoryFactory directoryFactory, String dirName, String suggestDirName,
                                boolean reindex, LuceneIndexWriterConfig writerConfig)
focal_class.identifier: DefaultIndexWriter
focal_class.modifiers: public
focal_class.parameters: (LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                                DirectoryFactory directoryFactory, String dirName, String suggestDirName,
                                boolean reindex, LuceneIndexWriterConfig writerConfig)
focal_class.signature:  DefaultIndexWriter(LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                                DirectoryFactory directoryFactory, String dirName, String suggestDirName,
                                boolean reindex, LuceneIndexWriterConfig writerConfig)
focal_class.class_method_signature: DefaultIndexWriter.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: DefaultIndexWriter.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: DefaultIndexWriter.deleteAll()
focal_class.full_signature:  void deleteAll()
focal_class.identifier: deleteAll
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void deleteAll()
focal_class.class_method_signature: DefaultIndexWriter.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: DefaultIndexWriter.getWriter()
focal_class.full_signature:  IndexWriter getWriter()
focal_class.identifier: getWriter
focal_class.parameters: ()
focal_class.return: IndexWriter
focal_class.signature: IndexWriter getWriter()
focal_class.class_method_signature: DefaultIndexWriter.updateSuggester(Analyzer analyzer, Calendar currentTime)
focal_class.full_signature: private boolean updateSuggester(Analyzer analyzer, Calendar currentTime)
focal_class.identifier: updateSuggester
focal_class.modifiers: private
focal_class.parameters: (Analyzer analyzer, Calendar currentTime)
focal_class.return: boolean
focal_class.signature: boolean updateSuggester(Analyzer analyzer, Calendar currentTime)
focal_class.class_method_signature: DefaultIndexWriter.shouldUpdateSuggestions(Calendar currentTime)
focal_class.full_signature: private boolean shouldUpdateSuggestions(Calendar currentTime)
focal_class.identifier: shouldUpdateSuggestions
focal_class.modifiers: private
focal_class.parameters: (Calendar currentTime)
focal_class.return: boolean
focal_class.signature: boolean shouldUpdateSuggestions(Calendar currentTime)
focal_class.class_method_signature: DefaultIndexWriter.isIndexUpdatedAfter(Calendar calendar)
focal_class.full_signature: private boolean isIndexUpdatedAfter(Calendar calendar)
focal_class.identifier: isIndexUpdatedAfter
focal_class.modifiers: private
focal_class.parameters: (Calendar calendar)
focal_class.return: boolean
focal_class.signature: boolean isIndexUpdatedAfter(Calendar calendar)
focal_class.class_method_signature: DefaultIndexWriter.getLatestGeneration(Directory directory)
focal_class.full_signature: private static long getLatestGeneration(Directory directory)
focal_class.identifier: getLatestGeneration
focal_class.modifiers: private static
focal_class.parameters: (Directory directory)
focal_class.return: long
focal_class.signature: long getLatestGeneration(Directory directory)
focal_class.class_method_signature: DefaultIndexWriter.trackIndexSizeInfo(@NotNull IndexWriter writer,
                                             @NotNull IndexDefinition definition,
                                             @NotNull Directory directory)
focal_class.full_signature: private static void trackIndexSizeInfo(@NotNull IndexWriter writer,
                                             @NotNull IndexDefinition definition,
                                             @NotNull Directory directory)
focal_class.identifier: trackIndexSizeInfo
focal_class.modifiers: private static
focal_class.parameters: (@NotNull IndexWriter writer,
                                             @NotNull IndexDefinition definition,
                                             @NotNull Directory directory)
focal_class.return: void
focal_class.signature: void trackIndexSizeInfo(@NotNull IndexWriter writer,
                                             @NotNull IndexDefinition definition,
                                             @NotNull Directory directory)
focal_method.body: @Override
      public boolean close(long timestamp) throws IOException {
          //If reindex or fresh index and write is null on close
          //it indicates that the index is empty. In such a case trigger
          //creation of write such that an empty Lucene index state is persisted
          //in directory
          if (reindex && writer == null){
              getWriter();
          }
  
          Calendar currentTime = Calendar.getInstance();
          currentTime.setTimeInMillis(timestamp);
          boolean updateSuggestions = shouldUpdateSuggestions(currentTime);
          if (writer == null && updateSuggestions) {
              log.debug("Would update suggester dictionary although no index changes were detected in current cycle");
              getWriter();
          }
  
          if (writer != null) {
              if (log.isTraceEnabled()) {
                  trackIndexSizeInfo(writer, definition, directory);
              }
  
              final long start = PERF_LOGGER.start();
  
              if (updateSuggestions) {
                  indexUpdated |= updateSuggester(writer.getAnalyzer(), currentTime);
                  PERF_LOGGER.end(start, -1, "Completed suggester for directory {}", definition);
              }
  
              writer.close();
              PERF_LOGGER.end(start, -1, "Closed writer for directory {}", definition);
  
              if (!indexUpdated){
                  long genAtEnd = getLatestGeneration(directory);
                  indexUpdated = genAtEnd != genAtStart;
              }
  
              directory.close();
              PERF_LOGGER.end(start, -1, "Closed directory for directory {}", definition);
          }
          return indexUpdated;
      }
focal_method.class_method_signature: DefaultIndexWriter.close(long timestamp)
focal_method.full_signature: @Override public boolean close(long timestamp)
focal_method.identifier: close
focal_method.invocations: getWriter getInstance setTimeInMillis shouldUpdateSuggestions debug getWriter isTraceEnabled trackIndexSizeInfo start updateSuggester getAnalyzer end close end getLatestGeneration close end
focal_method.modifiers: @Override public
focal_method.parameters: (long timestamp)
focal_method.return: boolean
focal_method.signature: boolean close(long timestamp)