You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Michael-O <19...@gmx.net> on 2012/11/01 22:27:58 UTC

How to correctly use SearcherManager#close?

Hi folks,

while I do understand the workflow with this class, I do not understand when to call close(). The JavaDoc is not crystal clear on that. Am I supposed to call this method after release() or when my webapp is destroyed?

Thanks,

Michael

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


Re: How to correctly use SearcherManager#close?

Posted by Michael-O <19...@gmx.net>.
> That would be great!
> 
> Hmm which version are you looking at?  In 4.0 it currently says this:
> 
>   /**
>    * Close this ReferenceManager to future {@link #acquire() acquiring}.
> Any
>    * references that were previously {@link #acquire() acquired} won't be
>    * affected, and they should still be {@link #release released} when
> they are
>    * not needed anymore.
>    */
> 
> How would you improve it?

Hi Mike,

I am on 3.6.1. The first sentence is not really clear. Maybe to native speakers but not to me. It does not clearly say: Close the Mananger when your app shuts down or when you want to dispose that index.

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


Re: How to correctly use SearcherManager#close?

Posted by Michael McCandless <lu...@mikemccandless.com>.
That would be great!

Hmm which version are you looking at?  In 4.0 it currently says this:

  /**
   * Close this ReferenceManager to future {@link #acquire() acquiring}. Any
   * references that were previously {@link #acquire() acquired} won't be
   * affected, and they should still be {@link #release released} when they are
   * not needed anymore.
   */

How would you improve it?

Mike McCandless

http://blog.mikemccandless.com


On Thu, Nov 1, 2012 at 6:30 PM, Michael-O <19...@gmx.net> wrote:
> Thanks for the quick response. Any chance this could be clearer in the JavaDoc of this class?
>
>> Call it when you know you'll no longer need to call .acquire on it
>> anymore (typically this would be when your webapp is being destroyed).
>>
>> Really all this does is drop its internal reference to the current
>> searcher.
>>
>> Any in-flight searches still outstanding will run fine (and they
>> should call .release, like normal, once they are done, even though
>> you've already called .close on the SearcherManager)...
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>> On Thu, Nov 1, 2012 at 5:27 PM, Michael-O <19...@gmx.net> wrote:
>> > Hi folks,
>> >
>> > while I do understand the workflow with this class, I do not understand
>> when to call close(). The JavaDoc is not crystal clear on that. Am I
>> supposed to call this method after release() or when my webapp is destroyed?
>> >
>> > Thanks,
>> >
>> > Michael
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> > For additional commands, e-mail: java-user-help@lucene.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

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


Re: How to correctly use SearcherManager#close?

Posted by Michael-O <19...@gmx.net>.
> hey michael,
> 
> On Thu, Nov 1, 2012 at 11:30 PM, Michael-O <19...@gmx.net> wrote:
> > Thanks for the quick response. Any chance this could be clearer in the
> JavaDoc of this class?
> 
> sure thing, do you wanna open an issues / create a patch I am happy to
> commit it.

Thanks Simon,

Issue created: https://issues.apache.org/jira/browse/LUCENE-4525

Grüße nach Kreuzberg!

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


Re: How to correctly use SearcherManager#close?

Posted by Simon Willnauer <si...@gmail.com>.
hey michael,

On Thu, Nov 1, 2012 at 11:30 PM, Michael-O <19...@gmx.net> wrote:
> Thanks for the quick response. Any chance this could be clearer in the JavaDoc of this class?

sure thing, do you wanna open an issues / create a patch I am happy to
commit it.

simon
>
>> Call it when you know you'll no longer need to call .acquire on it
>> anymore (typically this would be when your webapp is being destroyed).
>>
>> Really all this does is drop its internal reference to the current
>> searcher.
>>
>> Any in-flight searches still outstanding will run fine (and they
>> should call .release, like normal, once they are done, even though
>> you've already called .close on the SearcherManager)...
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>> On Thu, Nov 1, 2012 at 5:27 PM, Michael-O <19...@gmx.net> wrote:
>> > Hi folks,
>> >
>> > while I do understand the workflow with this class, I do not understand
>> when to call close(). The JavaDoc is not crystal clear on that. Am I
>> supposed to call this method after release() or when my webapp is destroyed?
>> >
>> > Thanks,
>> >
>> > Michael
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> > For additional commands, e-mail: java-user-help@lucene.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

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


Re: How to correctly use SearcherManager#close?

Posted by Michael-O <19...@gmx.net>.
Thanks for the quick response. Any chance this could be clearer in the JavaDoc of this class?

> Call it when you know you'll no longer need to call .acquire on it
> anymore (typically this would be when your webapp is being destroyed).
> 
> Really all this does is drop its internal reference to the current
> searcher.
> 
> Any in-flight searches still outstanding will run fine (and they
> should call .release, like normal, once they are done, even though
> you've already called .close on the SearcherManager)...
> 
> Mike McCandless
> 
> http://blog.mikemccandless.com
> 
> On Thu, Nov 1, 2012 at 5:27 PM, Michael-O <19...@gmx.net> wrote:
> > Hi folks,
> >
> > while I do understand the workflow with this class, I do not understand
> when to call close(). The JavaDoc is not crystal clear on that. Am I
> supposed to call this method after release() or when my webapp is destroyed?
> >
> > Thanks,
> >
> > Michael
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 

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


Re: How to correctly use SearcherManager#close?

Posted by Michael McCandless <lu...@mikemccandless.com>.
Call it when you know you'll no longer need to call .acquire on it
anymore (typically this would be when your webapp is being destroyed).

Really all this does is drop its internal reference to the current searcher.

Any in-flight searches still outstanding will run fine (and they
should call .release, like normal, once they are done, even though
you've already called .close on the SearcherManager)...

Mike McCandless

http://blog.mikemccandless.com

On Thu, Nov 1, 2012 at 5:27 PM, Michael-O <19...@gmx.net> wrote:
> Hi folks,
>
> while I do understand the workflow with this class, I do not understand when to call close(). The JavaDoc is not crystal clear on that. Am I supposed to call this method after release() or when my webapp is destroyed?
>
> Thanks,
>
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

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