@Test public void indexWriterConfig_Scheduler_Local() throws Exception{ FSDirectoryFactory fsdir = new FSDirectoryFactory(folder.getRoot()); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); DefaultIndexWriter writer = new DefaultIndexWriter(defn, builder, fsdir, INDEX_DATA_CHILD_NAME, SUGGEST_DATA_CHILD_NAME, true, writerConfig); IndexWriter w = writer.getWriter(); assertThat(w.getConfig().getMergeScheduler(), instanceOf(ConcurrentMergeScheduler.class)); }
IndexWriter getWriter() throws IOException { if (writer == null) { final long start = PERF_LOGGER.start(); directory = directoryFactory.newInstance(definition, definitionBuilder, dirName, reindex); IndexWriterConfig config = getIndexWriterConfig(definition, directoryFactory.remoteDirectory(), writerConfig); config.setMergePolicy(definition.getMergePolicy()); writer = new IndexWriter(directory, config); genAtStart = getLatestGeneration(directory); log.trace("IndexWriterConfig for index [{}] is {}", definition.getIndexPath(), config); PERF_LOGGER.end(start, -1, "Created IndexWriter for directory {}", definition); } return writer; }
DefaultIndexWriter implements LuceneIndexWriter { IndexWriter getWriter() throws IOException { if (writer == null) { final long start = PERF_LOGGER.start(); directory = directoryFactory.newInstance(definition, definitionBuilder, dirName, reindex); IndexWriterConfig config = getIndexWriterConfig(definition, directoryFactory.remoteDirectory(), writerConfig); config.setMergePolicy(definition.getMergePolicy()); writer = new IndexWriter(directory, config); genAtStart = getLatestGeneration(directory); log.trace("IndexWriterConfig for index [{}] is {}", definition.getIndexPath(), config); PERF_LOGGER.end(start, -1, "Created IndexWriter for directory {}", definition); } return writer; } }
DefaultIndexWriter implements LuceneIndexWriter { IndexWriter getWriter() throws IOException { if (writer == null) { final long start = PERF_LOGGER.start(); directory = directoryFactory.newInstance(definition, definitionBuilder, dirName, reindex); IndexWriterConfig config = getIndexWriterConfig(definition, directoryFactory.remoteDirectory(), writerConfig); config.setMergePolicy(definition.getMergePolicy()); writer = new IndexWriter(directory, config); genAtStart = getLatestGeneration(directory); log.trace("IndexWriterConfig for index [{}] is {}", definition.getIndexPath(), config); PERF_LOGGER.end(start, -1, "Created IndexWriter for directory {}", definition); } return writer; } DefaultIndexWriter(LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                              DirectoryFactory directoryFactory, String dirName, String suggestDirName,
                              boolean reindex, LuceneIndexWriterConfig writerConfig); }
DefaultIndexWriter implements LuceneIndexWriter { IndexWriter getWriter() throws IOException { if (writer == null) { final long start = PERF_LOGGER.start(); directory = directoryFactory.newInstance(definition, definitionBuilder, dirName, reindex); IndexWriterConfig config = getIndexWriterConfig(definition, directoryFactory.remoteDirectory(), writerConfig); config.setMergePolicy(definition.getMergePolicy()); writer = new IndexWriter(directory, config); genAtStart = getLatestGeneration(directory); log.trace("IndexWriterConfig for index [{}] is {}", definition.getIndexPath(), config); PERF_LOGGER.end(start, -1, "Created IndexWriter for directory {}", definition); } return writer; } DefaultIndexWriter(LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                              DirectoryFactory directoryFactory, String dirName, String suggestDirName,
                              boolean reindex, LuceneIndexWriterConfig writerConfig); @Override void updateDocument(String path, Iterable<? extends IndexableField> doc); @Override void deleteDocuments(String path); @Override boolean close(long timestamp); }
DefaultIndexWriter implements LuceneIndexWriter { IndexWriter getWriter() throws IOException { if (writer == null) { final long start = PERF_LOGGER.start(); directory = directoryFactory.newInstance(definition, definitionBuilder, dirName, reindex); IndexWriterConfig config = getIndexWriterConfig(definition, directoryFactory.remoteDirectory(), writerConfig); config.setMergePolicy(definition.getMergePolicy()); writer = new IndexWriter(directory, config); genAtStart = getLatestGeneration(directory); log.trace("IndexWriterConfig for index [{}] is {}", definition.getIndexPath(), config); PERF_LOGGER.end(start, -1, "Created IndexWriter for directory {}", definition); } return writer; } DefaultIndexWriter(LuceneIndexDefinition definition, NodeBuilder definitionBuilder,
                              DirectoryFactory directoryFactory, String dirName, String suggestDirName,
                              boolean reindex, LuceneIndexWriterConfig writerConfig); @Override void updateDocument(String path, Iterable<? extends IndexableField> doc); @Override void deleteDocuments(String path); @Override boolean close(long timestamp);  }