>
> Hmm prepareCommit() really should somehow pass true: this API is only
> invoked by the app, not by IW internally during close.


Currently, the app can call prepareCommit() or prepareCommint(data), the
former calls ensureOpen(true), the latter ensureOpen(false).

The problem is that the latter is called by internalCommit(). So when I
changed prepareCommit(data) to call ensureOpen(true), all TestIndexWriter
tests failed (the only ones I tried).

So I think that in that issue, I should create an internalPrepareCommit and
leave prepCommit() to call ensureOpen(), while internalPrep will call
ensureOpen(false). And also change IW code to call internalCommit. How's
that sound?

+1 for failIfClosing !

Shai

On Fri, Nov 30, 2012 at 3:29 PM, Michael McCandless <
luc...@mikemccandless.com> wrote:

> On Fri, Nov 30, 2012 at 7:13 AM, Shai Erera <ser...@gmail.com> wrote:
> > I see. So two questions:
> >
> > 1) Is it ok for prepareCommit() to call ensureOpen(false)? In
> LUCENE-4575 I
> > consolidate the two prepCommit() and this is the only way it would work
> ...
>
> Hmm prepareCommit() really should somehow pass true: this API is only
> invoked by the app, not by IW internally during close.  Not sure how
> we can fix the patch to get that back ...
>
> > 2) Could you perhaps clarify the use of the second argument in the
> javadocs?
> > Maybe also rename it to something like "fail if closing"? The name
> > "includePendingClose" is vague perhaps consider*?)
>
> I agree that current name is no good!  failIfClosing seems good?
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: dev-h...@lucene.apache.org
>
>

Reply via email to