[ https://issues.apache.org/jira/browse/LUCENE-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12935767#action_12935767 ]
Michael McCandless commented on LUCENE-2691: -------------------------------------------- bq. You're still okay with an API that allows you to reopen IRs on different directories? Well, that's no good - we can catch this and throw an exc? bq. I think reopen should have no parameters, and IR.reopen(IC) moved elsewhere. But where would you move IR.reopen(IC)? bq. I'd personally like to see a special subclass of DIR that is returned from IW.getReader(), that knows about specifics of being opened over an active writer. That sounds great! {quote} If we allow reopen to switch readers between modes, we're introducing yet more checking and switching around. Also we'll get irreversible circular dependency between readers and writers, which is also a sign of things going wrong. {quote} Really, there are two separate "things" open/reopen needs: # The SegmentInfos -- either by finding the latest & greatest in the Directory, latest & greatest via IW, or explicitly via an IndexCommit. # A prior pool of readers so that anything needing a reader (IW doing a merge, IW applying deletes, app opening new readers, etc.) can re-use any already open sub readers. Maybe we can split these out. EG we've wanted for a while now to factor out the reader pool hidden inside IW. If we did this, and then allowed optionally passing a pool to IR.open, I think we could do away with IR.reopen entirely? We'd have variants of IR.open taking IW, Dir, IndexCommit, to say where the SegmentInfos come from, and then optionally also taking the explicit reader pool. > Consolidate Near Real Time and Reopen API semantics > --------------------------------------------------- > > Key: LUCENE-2691 > URL: https://issues.apache.org/jira/browse/LUCENE-2691 > Project: Lucene - Java > Issue Type: Improvement > Reporter: Grant Ingersoll > Assignee: Grant Ingersoll > Priority: Minor > Fix For: 4.0 > > Attachments: LUCENE-2691.patch, LUCENE-2691.patch > > > We should consolidate the IndexWriter.getReader and the IndexReader.reopen > semantics, since most people are already using the IR.reopen() method, we > should simply add:: > {code} > IR.reopen(IndexWriter) > {code} > Initially, it could just call the IW.getReader(), but it probably should > switch to just using package private methods for sharing the internals -- 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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org