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

Michael McCandless commented on LUCENE-743:
-------------------------------------------

Looks great!  All tests pass for me.

{quote}
OK I see. I made this change as well. I also made the change that
there is no chain, but one starting SegmentReader which all re-opened
ones reference (see below). Now this starting SegmentReader won't close
its norms until all other readers that reference it are closed (RC=0),
because only then doClose() is called, which calls closeNorms().
Do you see an easy way how to improve this?
{quote}

How about if SegmentReader.close() always calls Norm.decRef(),
immediately, for each Norm is has open?  EG you could implement
doCloseUnsharedResources in SegmentReader and do it there).  This way,
if the SegmentReader has been closed but it shares resources (and not
the Norms) with reopened SegmentReaders then its Norms would all
decRef to 0 & be closed.

Also make sure that if a SegmentReader is decRef'd to 0 and close was
never called, that also in this case you remember to call Norm.decRef
for all open norms.

One more comment: I think you can partially share Norm instances?  Eg
if I have 2 fields that have norms, but only one of them changed since
I opened this SegmentReader, then the reopened SegmentReader could
share the Norm instance of the field that didn't change with the old
SegmentReader?  But right now you're re-loading all the Norms.

Otherwise no more comments!

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

Reply via email to