lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Updated: (LUCENE-1329) Remove synchronization in SegmentReader.isDeleted
Date Fri, 08 Aug 2008 19:27:44 GMT


Michael McCandless updated LUCENE-1329:

    Attachment: LUCENE-1329.patch

I took a first cut at creating an explicit read only IndexReader
(attached), which is an alternative to the first patch here.

I added "boolean readOnly" to 3 of the IndexReader open methods, and
created ReadOnlySegmentReader and ReadOnlyMultiSegmentReader.  The
classes are trivial -- they subclass the parent and just override
acquireWriteLock (to throw an exception) and isDeleted.

reopen() also preserves readOnly-ness, and I fixed merging to open readOnly

bq. We could safely do this for a deleting-reader by pre-allocating the BitVector objects,
thus eliminating the possibility of a thread seeing a partially constructed object.

I didn't do this one yet ... it makes me a bit nervous because it
means that people who just do on an index with no
deletions pay the RAM cost upfront of allocating the BitVector.

Really, I think we want to default to be
readOnly=true (which we can't do until 3.0) at which point doing the
above seems safer since you'd have to go out of your way to open a
non-readOnly IndexReader.

> Remove synchronization in SegmentReader.isDeleted
> -------------------------------------------------
>                 Key: LUCENE-1329
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3.1
>            Reporter: Jason Rutherglen
>            Priority: Trivial
>         Attachments: LUCENE-1329.patch, lucene-1329.patch
> Removes SegmentReader.isDeleted synchronization by using a volatile deletedDocs variable
on Java 1.5 platforms.  On Java 1.4 platforms synchronization is limited to obtaining the
deletedDocs reference.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message