Yonik Seeley wrote:
On Tue, Jun 2, 2009 at 4:54 AM, Shai Erera <ser...@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-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

I was thinking you have a read-only snapshot to check on the deletes though. Another thread can't do a delete with that Reader, and if they are doing it on another Reader, it wouldn't
affect the snapshot the read-only Reader had opened?

--
- Mark

http://www.lucidimagination.com




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

Reply via email to