[ https://issues.apache.org/jira/browse/LUCENE-3734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13197074#comment-13197074 ]
Jason Rutherglen commented on LUCENE-3734: ------------------------------------------ The issues mentioned were brought up in LUCENE-3498 and LUCENE-3497 thus yielding a +1 from me. > Allow customizing/subclassing of DirectoryReader > ------------------------------------------------ > > Key: LUCENE-3734 > URL: https://issues.apache.org/jira/browse/LUCENE-3734 > Project: Lucene - Java > Issue Type: Sub-task > Components: core/index > Reporter: Uwe Schindler > Assignee: Uwe Schindler > Fix For: 4.0 > > Attachments: LUCENE-3734.patch > > > DirectoryReader is final and has only static factory methods. It is not > possible to subclass it in any way. > The problem is mainly Solr, as Solr accesses directory(), IndexCommits,... > and therefore cannot work on abstract IndexReader anymore. This should be > changed, by e.g. handling reopening in the IRFactory, also versions, > commits,... Currently its not possible to implement any other IRFactory that > returns something else. > On the other hand, it should be possible to "wrap" a DirectoryReader / > CompositeReader to handle filtering of collection based information > (subreaders, reopening hooks,...). This can be done by making DirectoryReader > abstract and let DirectoryReader.open return a internal hidden class > "StandardDirectoryReader". This is similar to the relatinship between > IndexReader and hidden DirectoryReader in the past. > DirectoryReader will have final implementations of most methods like getting > document stored fields, global docFreq and other statistics, but allows > hooking into doOpenIfChanged. Also it should not be limited to SegmentReaders > as childs - any AtomicReader is fine. This allows users to create e.g. a > Directory-based ParallelReader (see LUCENE-3736) that supports reopen and > (partially commits). -- 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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org