lucene-dev mailing list archives

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


Shai Erera commented on LUCENE-1707:

I tried using closed, but TestIndexReaderReopen fails. It appears that closed is used mainly
to not execute close() twice (i.e., after you call it once, calling it again will do nothing)
on the same instance. Even after I set closed to false wherever it should be (wherever refCount
is increased or set to greater than 0), and set it to true in decRef()'s "if (refCount ==
1)" section, the test fails. If I come up w/ isOpen, the test passes.

I think it's because IndexWriter.ReadersPool closes a reader, and the test then attempts to
close the reader again, then comparing the ref counts. So I'm not sure closed can be used.

> 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