[ 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-take3.patch Ok here is the next one :-)... This patch implements the refCounting as discussed with Mike and Yonik above. Other changes/improvements/comments: - ensureOpen() is now also called in MultiReader.reopen() and ParallelReader.reopen(). (thanks, Mike) - in case an exception occurs during reopen() it is taken care of closing or decreasing the refCount of already created readers. Also old readers should not be affected in case an exception occurs. - I improved how norms are re-opened in a MultiSegmentReader (MSR). It now checks which parts of the normsCache haven't changed and copies those to the new normsCache. Because I'm imagining Yonik with his thread-safety hat on now ;), another comment about this: In case a MSR is refreshed, then the synchronized MSR.reopen() method has the lock on the old MSR. This method creates the new MSR and the values from the old cache are copied to the new cache in the constructor, so while the lock on the old MSR is still being held. - added new constructors to MultiReader and ParallelReader that increase the refCount on the subReaders and thus prevent closing the subReaders on close(). (thanks, Yonik) I also made the changes suggested by Hoss (thanks!): - changed the "successfully reopened" comments int the javadocs - added comments to the javadocs saying that write operations on the re-opened reader will result in undefined behavior unless the old reader is closed - FilterIndexReader.reopen() not implemented, i. e. will throw an UnsupportedOperationException. All unit tests pass. > 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.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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]