lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-743) IndexReader.reopen()
Date Fri, 02 Nov 2007 14:43:50 GMT


Michael McCandless commented on LUCENE-743:

OK, reviewed the latest patch:

* In this code:
// singleNormFile means multiple norms share this file
if (fileName.endsWith("." + IndexFileNames.NORMS_EXTENSION)) {
  clone.singleNormStream = d.openInput(fileName, readBufferSize);            
  I think the comment should be removed (it doens't apply) and also
  won't this incorrectly open the singleNormStream more than once if
  more than one field does not have separate norms?  I think you should
  init that to null and then only reopen it, once, if it's still null?

* In MultiSegmentReader, the logic that copies over unchanged norms
  from the old norms cache can be simplified.  I think you can just
  look up the old Norm instance & the new Norm instance and if they
  are == then you can copy bytes over?  This would also let you remove
  "sharedNorms" entirely which is good because it's not a just a
  boolean thing anymore since some Norm instances are shared and some

* I think you also need to override decRef (and add
  decRefReaderNotNorms) to SegmentReader?  Because now there is a
  mismatch: incRef incr's the Norm RC's, but, decRef does not.  So I
  think norms are not getting closed?  I think we should modify the
  "assertReaderClosed()" in the unit test to verify (when appropriate)
  that also the RC of all Norm instances is also 0 (ie
  assertTrue(SR.normsClosed())).  Then, make sure SR calls
  referencedSegmentReader.decRefReaderNotNorms instead of decRef.  I
  think you then don't need to track "closedNorms" boolean, at all.
  You simply always decRef the norms whenever SR.decRef is called.
  The doCloseUnsharedResources is still needed to close the

> IndexReader.reopen()
> --------------------
>                 Key: LUCENE-743
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Otis Gospodnetic
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.3
>         Attachments:, 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,,, 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:
For additional commands, e-mail:

View raw message