lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: ReadOnly IndexReaders
Date Thu, 04 Jun 2009 13:29:45 GMT
On Tue, Jun 2, 2009 at 4:54 AM, Shai Erera <serera@gmail.com> wrote:
> You could call reader.hasDeletions to decide whether you should call
> isdeleted()? But you cannot use that alone, since if a library receives an
> IndexReader, it cannot rely solely on hasDeletions, since at an upper level
> someone might decide to delete a document w/ that reader, and therefore it
> needs to couple hasDeletions with isReadOnly. I think?

If you try to write a separate component that does stuff on an index
reader, and another thread is deleting stuff out from under you, then
you're going to be in trouble no matter what.  Calling isDeleted()
isn't going to help (think race conditions.)  Synchronization would be
needed at a higher level in the app to coordinate things.

-Yonik
http://www.lucidimagination.com

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


Mime
View raw message