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

Hoss Man commented on LUCENE-986:
---------------------------------

one aspect of this that should be considered: It may not make sense for 
MultiReader to extend MultiSegmentReader ... as Michael says, only subclasses 
that own the index directory should have segmentInfos, and a MultiReader (as 
defined on the trunk now) can never own it's own directory.

I haven't worked through all the implications, but perhaps the most logical 
refactoring would be...

 * IndexReader 
    ...as abstract as possible given that we can't actually make methods 
abstract
    * DirectoryIndexReader extends IndexReader
       ...new class, encapsulated all the segmentInfos and locking logic 
currently in 
          IndexReader (can definitely be made abstract if helpful)
       * SegmentReader extends DirectoryIndexReader
       * MultiSegmentReader extends DirectoryIndexReader
    * ParallelIndexReader extends IndexReader
    * FilterIndexReader extends IndexReader
    * MultiReader extends IndexReader
       ...(side note that i *really* haven't thought through completley: should 
          MultiReader extend FilterIndexReader?)

there would likely be some utlity functionality that could be reused between 
MultiReader and MultiSegmentReader ... possible as static methods in 
IndexReader (or a new util class)



> Refactor segmentInfos from IndexReader into its subclasses
> ----------------------------------------------------------
>
>                 Key: LUCENE-986
>                 URL: https://issues.apache.org/jira/browse/LUCENE-986
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Michael Busch
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.3
>
>
> References to segmentInfos in IndexReader cause different kinds of problems
> for subclasses of IndexReader, like e. g. MultiReader.
> Only subclasses of IndexReader that own the index directory, namely 
> SegmentReader and MultiSegmentReader, should have a SegmentInfos object
> and be able to access it.
> Further information:
> http://www.gossamer-threads.com/lists/lucene/java-dev/51808
> http://www.gossamer-threads.com/lists/lucene/java-user/52460
> A part of the refactoring work was already done in LUCENE-781

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