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

Jason Rutherglen updated LUCENE-1314:
-------------------------------------

    Attachment: LUCENE-1314.patch

LUCENE-1314.patch

- Added TestIndexReaderCloneNorms because cloning the norms is really hard to 
do implemented as copy on write.  There seem to be many caveats such as whether 
or not the norms stream is still open?  testNormsRefCounting fails with a 
corruptedIndexException which I'm investigating.  

I now remember implementing a copy of just the bytes, and only editting them in 
the Norm object to get around these issues.  Basically on clone, new Norm 
objects and a Map is created but the byte array of the cloned norm is shared.  
On a write, the bytes are cloned.  This gets around needing to deal with the 
reader norm reference counting used by reopen, though is this a good idea?

I'll try that and see if it works.  Otherwise, suggestions besides hard cloning 
the norms for each clone?

> IndexReader.clone
> -----------------
>
>                 Key: LUCENE-1314
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1314
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Index
>    Affects Versions: 2.3.1
>            Reporter: Jason Rutherglen
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1314.patch, LUCENE-1314.patch, LUCENE-1314.patch, 
> lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, 
> lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, 
> lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch
>
>
> Based on discussion 
> http://www.nabble.com/IndexReader.reopen-issue-td18070256.html.  The problem 
> is reopen returns the same reader if there are no changes, so if docs are 
> deleted from the new reader, they are also reflected in the previous reader 
> which is not always desired behavior.

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

Reply via email to