lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Busch (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-743) IndexReader.reopen()
Date Fri, 02 Nov 2007 09:53:50 GMT

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

Michael Busch updated LUCENE-743:
---------------------------------

    Attachment: lucene-743-take5.patch

OK, I think it's finally working now! :-)

SegmentReader now overwrites incRef() and increments the readers RC,
as well as the RCs of all norms. I further added the private method
incRefReaderNotNorms() to SegmentReader, which is called in 
reopenSegment(), because it takes care of incrementing the RCs of
all shared norms.

I also added the method doCloseUnsharedResources() to IndexReader,
which is a NOOP by default. It is called when a reader is closed,
even if its RC > 0. SegmentReader overwrites this method and 
closes (=decRef) the norms in it. The SegmentReader then remembers
that it closed the norms already and won't close them again in
doClose(), which is called when its RC finally drops to 0.

I also made the change you suggested, Mike, to only reload the 
field norms that actually changed. SegmentReader.openNorms() now
checks if there is already a norm for a field in the HashTable,
and only loads it if it's not there. reopenSegment() puts all
norms in the new SegmentReader that haven't changed.

I added some new tests to verify the norms ref counting. All unit
tests pass now. So I think this is ready to commit, but I'd feel 
more comfortable if you could review it again before I commit it.

> IndexReader.reopen()
> --------------------
>
>                 Key: LUCENE-743
>                 URL: https://issues.apache.org/jira/browse/LUCENE-743
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Otis Gospodnetic
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.3
>
>         Attachments: IndexReaderUtils.java, lucene-743-take2.patch, lucene-743-take3.patch,
lucene-743-take4.patch, lucene-743-take5.patch, lucene-743.patch, lucene-743.patch, lucene-743.patch,
MyMultiReader.java, MySegmentReader.java, varient-no-isCloneSupported.BROKEN.patch
>
>
> This is Robert Engels' implementation of IndexReader.reopen() functionality, as a set
of 3 new classes (this was easier for him to implement, but should probably be folded into
the core, if this looks good).

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message