lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-1707) Don't use ensureOpen() excessively in IndexReader and IndexWriter
Date Thu, 25 Jun 2009 14:52:07 GMT


Michael McCandless commented on LUCENE-1707:

bq. IndexReader already has a 'closed' member which is set to true in close(). Why not use

Ahh perfect let's use that!

bq. In fact, it's strange - close() decreases refCount and set 'closed' to true, but if decRef()
is called from another reader (it is a public method, so maybe even from an outside app),
and refCount is 0, close() will call decRef() again, and fail on assert refCount > 0.

If decRef() is called and refCount is 0, doClose() (not close()) is called.  I think this
is right?

> Don't use ensureOpen() excessively in IndexReader and IndexWriter
> -----------------------------------------------------------------
>                 Key: LUCENE-1707
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Shai Erera
>             Fix For: 2.9
>         Attachments: LUCENE-1707.patch
> A spin off from here:
> We should stop calling this method when it's not necessary for any internal Lucene code.
Currently, this code seems to hurt properly written apps, unnecessarily.
> Will post a patch soon

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:
For additional commands, e-mail:

View raw message