lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <>
Subject Re: ReadOnly IndexReaders
Date Thu, 04 Jun 2009 13:37:58 GMT
Yonik Seeley wrote:
> On Tue, Jun 2, 2009 at 4:54 AM, Shai Erera <> 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
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message