lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject [lucene-solr] 02/02: @719 Lookup build methods can raise with file work and cause lookup build fails.
Date Thu, 03 Sep 2020 15:06:45 GMT
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 6800ee73c0abc8232252bd26b014797883ad4cf3
Author: markrmiller@gmail.com <markrmiller@gmail.com>
AuthorDate: Thu Sep 3 10:02:32 2020 -0500

    @719 Lookup build methods can raise with file work and cause lookup build fails.
---
 .../org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java  | 2 +-
 .../java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java  | 2 +-
 .../java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java | 2 +-
 .../src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java        | 2 +-
 solr/core/src/java/org/apache/solr/spelling/suggest/SolrSuggester.java  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
index a03ae22..37d64de 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/AnalyzingSuggester.java
@@ -401,7 +401,7 @@ public class AnalyzingSuggester extends Lookup implements Accountable
{
   }
 
   @Override
-  public void build(InputIterator iterator) throws IOException {
+  public synchronized void build(InputIterator iterator) throws IOException {
     if (iterator.hasContexts()) {
       throw new IllegalArgumentException("this suggester doesn't support contexts");
     }
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
index 7db97a8..53db6eb 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/FSTCompletionLookup.java
@@ -163,7 +163,7 @@ public class FSTCompletionLookup extends Lookup implements Accountable
{
   }
 
   @Override
-  public void build(InputIterator iterator) throws IOException {
+  public synchronized void build(InputIterator iterator) throws IOException {
     if (iterator.hasPayloads()) {
       throw new IllegalArgumentException("this suggester doesn't support payloads");
     }
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java
b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java
index 9c8ebb8..aa6676f 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/WFSTCompletionLookup.java
@@ -103,7 +103,7 @@ public class WFSTCompletionLookup extends Lookup implements Accountable
{
   }
   
   @Override
-  public void build(InputIterator iterator) throws IOException {
+  public synchronized void build(InputIterator iterator) throws IOException {
     if (iterator.hasPayloads()) {
       throw new IllegalArgumentException("this suggester doesn't support payloads");
     }
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java
index d0b9247..7948f44 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/tst/TSTLookup.java
@@ -109,7 +109,7 @@ public class TSTLookup extends Lookup {
   };
 
   @Override
-  public void build(InputIterator iterator) throws IOException {
+  public synchronized void build(InputIterator iterator) throws IOException {
     if (iterator.hasPayloads()) {
       throw new IllegalArgumentException("this suggester doesn't support payloads");
     }
diff --git a/solr/core/src/java/org/apache/solr/spelling/suggest/SolrSuggester.java b/solr/core/src/java/org/apache/solr/spelling/suggest/SolrSuggester.java
index 288b4ea..f1ac66e 100644
--- a/solr/core/src/java/org/apache/solr/spelling/suggest/SolrSuggester.java
+++ b/solr/core/src/java/org/apache/solr/spelling/suggest/SolrSuggester.java
@@ -176,7 +176,7 @@ public class SolrSuggester implements Accountable {
   }
 
   /** Build the underlying Lucene Suggester */
-  public void build(SolrCore core, SolrIndexSearcher searcher) throws IOException {
+  public synchronized void build(SolrCore core, SolrIndexSearcher searcher) throws IOException
{
     log.info("SolrSuggester.build({})", name);
 
     dictionary = dictionaryFactory.create(core, searcher);


Mime
View raw message