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

Uwe Schindler commented on LUCENE-3736:
---------------------------------------

bq. Another question: do we even need a ParallelCompositeReader? Can't we
have only the Builder, and that returns a MultiReader?

The problem why we need ParallelCompositeReader is that the refCounting and 
close logic is different. MultiReader will close/refcount its childs, but the 
ParallelCompositeReader must close/refcount the parallel sub readers. If you 
return a simple MultiReader, all tests fail, because something is closing the 
subreaders of the original parallel Composite/DirectoryReaders (as they are 
closed by the wrappers), but the original CompositeReaders stay open.

If the parallel readers are DirectoryReaders it goes very bad, as the wrapped 
SegmentReaders are closed...

The change does the following: It returns a BaseMultiReader of 
ParallelAtomicReaders that wrap e.g. the SegmentReaders of a DirectoryReader. 
On close it decRefs or closes the original wrapped DirectoryReader, but does 
not touch the subreaders. In contrast, a normal MultiReader would close/decRef 
the inner ParallelAtomicReaders, which itsself cose the SegmentReaders they 
wrap. The DirectoryReaders would still be open.
                
> ParallelReader is now atomic, rename to ParallelAtomicReader and also add a 
> ParallelCompositeReader (that requires LogDocMergePolicy to have identical 
> subreader structure)
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3736
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3736
>             Project: Lucene - Java
>          Issue Type: Sub-task
>          Components: core/index
>            Reporter: Uwe Schindler
>            Assignee: Michael McCandless
>             Fix For: 4.0
>
>         Attachments: LUCENE-3736.patch, LUCENE-3736.patch, LUCENE-3736.patch
>
>
> The plan is:
> - Move all subreaders to ctor (builder-like API. First build reader-set, then 
> call build)
> - Rename ParallelReader to ParallelAtomicReader
> - Add a ParallelCompositeReader with same builder API, but taking any 
> CompositeReader-set and checks them that they are aligned (docStarts 
> identical). The subreaders are ParallelAtomicReaders.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to