You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Steve Rowe <sa...@gmail.com> on 2016/08/23 19:44:41 UTC

Re: [1/2] lucene-solr:master: SEARCH-9406: SolrSuggester should selectively register close hook

Hi Joel, 

Since you misspelled the JIRA issue as “SEARCH-9406” (rather than “SOLR-9406”), the commit didn’t get added as a comment on the JIRA - could you add a comment there manually for it?

--
Steve
www.lucidworks.com

> On Aug 23, 2016, at 3:25 PM, jbernste@apache.org wrote:
> 
> Repository: lucene-solr
> Updated Branches:
>  refs/heads/master c6c3166bf -> 49ba37ac4
> 
> 
> SEARCH-9406: SolrSuggester should selectively register close hook
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
> Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a1b55eb7
> Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a1b55eb7
> Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a1b55eb7
> 
> Branch: refs/heads/master
> Commit: a1b55eb743a6826299f155f95e41676fc33b576a
> Parents: c6c3166
> Author: jbernste <jb...@apache.org>
> Authored: Mon Aug 22 11:50:37 2016 -0400
> Committer: jbernste <jb...@apache.org>
> Committed: Tue Aug 23 15:02:35 2016 -0400
> 
> ----------------------------------------------------------------------
> .../solr/spelling/suggest/SolrSuggester.java    | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a1b55eb7/solr/core/src/java/org/apache/solr/spelling/suggest/SolrSuggester.java
> ----------------------------------------------------------------------
> 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 3dff0e4..b4ca4da 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
> @@ -118,21 +118,23 @@ public class SolrSuggester implements Accountable {
>     // initialize appropriate lookup instance
>     factory = core.getResourceLoader().newInstance(lookupImpl, LookupFactory.class);
>     lookup = factory.create(config, core);
> -    core.addCloseHook(new CloseHook() {
> -      @Override
> -      public void preClose(SolrCore core) {
> -        if (lookup != null && lookup instanceof Closeable) {
> +    
> +    if (lookup != null && lookup instanceof Closeable) {
> +      core.addCloseHook(new CloseHook() {
> +        @Override
> +        public void preClose(SolrCore core) {
>           try {
>             ((Closeable) lookup).close();
>           } catch (IOException e) {
>             LOG.warn("Could not close the suggester lookup.", e);
>           }
>         }
> -      }
> -      
> -      @Override
> -      public void postClose(SolrCore core) {}
> -    });
> +
> +        @Override
> +        public void postClose(SolrCore core) {
> +        }
> +      });
> +    }
> 
>     // if store directory is provided make it or load up the lookup with its content
>     if (store != null && !store.isEmpty()) {
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org