mirror of https://github.com/apache/nifi.git
NIFI-239: Updated deprecated method calls to use newer versions
This commit is contained in:
parent
9ba8defc09
commit
b6d5a68f75
|
@ -22,7 +22,6 @@
|
|||
</parent>
|
||||
|
||||
<artifactId>persistent-provenance-repository</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>Persistent Provenance Repository</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ public class DeleteIndexAction implements ExpirationAction {
|
|||
final List<File> indexDirs = indexConfiguration.getIndexDirectories(expiredFile);
|
||||
for (final File indexingDirectory : indexDirs) {
|
||||
try (final Directory directory = FSDirectory.open(indexingDirectory);
|
||||
final Analyzer analyzer = new StandardAnalyzer(LuceneUtil.LUCENE_VERSION)) {
|
||||
final Analyzer analyzer = new StandardAnalyzer()) {
|
||||
IndexWriterConfig config = new IndexWriterConfig(LuceneUtil.LUCENE_VERSION, analyzer);
|
||||
config.setWriteLockTimeout(300000L);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import org.apache.lucene.util.Version;
|
|||
|
||||
public class LuceneUtil {
|
||||
|
||||
public static final Version LUCENE_VERSION = Version.LUCENE_43;
|
||||
public static final Version LUCENE_VERSION = Version.LATEST;
|
||||
|
||||
public static String substringBefore(final String value, final String searchValue) {
|
||||
final int index = value.indexOf(searchValue);
|
||||
|
|
|
@ -16,15 +16,6 @@
|
|||
*/
|
||||
package org.apache.nifi.provenance;
|
||||
|
||||
import org.apache.nifi.provenance.PersistentProvenanceRepository;
|
||||
import org.apache.nifi.provenance.RepositoryConfiguration;
|
||||
import org.apache.nifi.provenance.IndexConfiguration;
|
||||
import org.apache.nifi.provenance.AsyncLineageSubmission;
|
||||
import org.apache.nifi.provenance.SearchableFields;
|
||||
import org.apache.nifi.provenance.StandardProvenanceEventRecord;
|
||||
import org.apache.nifi.provenance.ProvenanceEventType;
|
||||
import org.apache.nifi.provenance.ProvenanceEventRecord;
|
||||
import org.apache.nifi.provenance.ProvenanceEventBuilder;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
@ -43,6 +34,16 @@ import java.util.concurrent.ExecutorService;
|
|||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.core.SimpleAnalyzer;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.queryparser.classic.ParseException;
|
||||
import org.apache.lucene.queryparser.classic.QueryParser;
|
||||
import org.apache.lucene.search.IndexSearcher;
|
||||
import org.apache.lucene.search.ScoreDoc;
|
||||
import org.apache.lucene.search.TopDocs;
|
||||
import org.apache.lucene.store.FSDirectory;
|
||||
import org.apache.nifi.events.EventReporter;
|
||||
import org.apache.nifi.flowfile.FlowFile;
|
||||
import org.apache.nifi.provenance.lineage.EventNode;
|
||||
|
@ -58,18 +59,6 @@ import org.apache.nifi.provenance.search.SearchableField;
|
|||
import org.apache.nifi.provenance.serialization.RecordReader;
|
||||
import org.apache.nifi.provenance.serialization.RecordReaders;
|
||||
import org.apache.nifi.reporting.Severity;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.core.SimpleAnalyzer;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.queryparser.classic.ParseException;
|
||||
import org.apache.lucene.queryparser.classic.QueryParser;
|
||||
import org.apache.lucene.search.IndexSearcher;
|
||||
import org.apache.lucene.search.ScoreDoc;
|
||||
import org.apache.lucene.search.TopDocs;
|
||||
import org.apache.lucene.store.FSDirectory;
|
||||
import org.apache.lucene.util.Version;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
|
@ -1058,8 +1047,8 @@ public class TestPersistentProvenanceRepository {
|
|||
try (final DirectoryReader directoryReader = DirectoryReader.open(FSDirectory.open(indexDirectory))) {
|
||||
final IndexSearcher searcher = new IndexSearcher(directoryReader);
|
||||
|
||||
final Analyzer analyzer = new SimpleAnalyzer(Version.LUCENE_43);
|
||||
final org.apache.lucene.search.Query luceneQuery = new QueryParser(Version.LUCENE_43, "uuid", analyzer).parse(query);
|
||||
final Analyzer analyzer = new SimpleAnalyzer();
|
||||
final org.apache.lucene.search.Query luceneQuery = new QueryParser("uuid", analyzer).parse(query);
|
||||
|
||||
final Query q = new Query("");
|
||||
q.setMaxResults(1000);
|
||||
|
|
Loading…
Reference in New Issue