On Wed, Oct 27, 2010 at 1:01 PM, Pulkit Singhal <pulkitsing...@gmail.com> wrote:

> 1st of all, great book.

Thank you!

> @Question3: It sounds like an IndexReader always starts with a count of zero
> but that should not be a cause of worry because the value only gets acted
> upon in a call to decRef() ... am I right?

Actually, refCount of a new IndexReader starts at 1.  Then the caller
must call close (which under the hood calls decRef) to drop it to 0.

> @Question4: It seems to me that based on you explanation so far, the
> IndexReader will end up closing after the very 1st search. That doesn't
> sound too efficient given that keeping it alive and kicking is something
> that is highly desirable ... no? Am I missing something or does that
> responsibility fall elsewhere?

Actually, no -- SearcherManager also holds a ref.  So when there are
no queries in flight, the refCount will be 1.  It's only when the
searcher is swapped out for a new one that we decRef the old one and
its refCount drops to 0 (once all in-flight queries finish).

> I hope I haven't hijacked my own thread?

I don't think so!

Mike

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

Reply via email to