[ 
https://issues.apache.org/jira/browse/LUCENE-1329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

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
IndexReaders.

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 IndexReader.open on an index with no
deletions pay the RAM cost upfront of allocating the BitVector.

Really, I think we want to default IndexReader.open 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: https://issues.apache.org/jira/browse/LUCENE-1329
>             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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to