lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LUCENE-1314) IndexReader.reopen(boolean force)
Date Thu, 03 Jul 2008 11:48:45 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-1314?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael McCandless updated LUCENE-1314:
---------------------------------------

    Attachment: lucene-1314.patch

I don't think we need to check isCurrent() in doCommit() because since
the reader holds the write lock it is necessarily current?

I can't compile with your patch.  It seems like you have changes to
BitVector.java which did't make it into the patch?  Eg the getBits()
method.

I attached a new version with these changes:

  * Throw IllegalStateException if you try to clone a reader that has
    pending changes.

  * Clone the SegmentInfos, instead of just taking a reference, in
    DirectoryIndexReader

  * Changed "public abstract Object clone()" in IndexReader to be a
    method that throws UnsupportedOperationException instead

  * Renamed a few things; removed some whitespace only diffs.

  * Factored up doReopenOrClone into IndexReader

One difference between clone() and reopen() is you force the
deletedDocs BitVector to be cloned in SegmentReader during clone(),
but not during reopen().  With reopen() we "declared" that if you make
changes to your reopened reader, it's undefined what happens to your
old readers.  Ie, it's a "don't do that" situation.

But with clone() the situation is reversed: the whole reason why you
make a clone() is to isolate any changes in the new reader from being
visible to the old reader.  Given that, I think you also must clone()
the norms right?

Jason could you add cloning of norms, and add some unit tests, to the
patch?  Thanks.



> IndexReader.reopen(boolean force)
> ---------------------------------
>
>                 Key: LUCENE-1314
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1314
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Index
>    Affects Versions: 2.3.1
>            Reporter: Jason Rutherglen
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch,
lucene-1314.patch, lucene-1314.patch
>
>
> Based on discussion http://www.nabble.com/IndexReader.reopen-issue-td18070256.html. 
The problem is reopen returns the same reader if there are no changes, so if docs are deleted
from the new reader, they are also reflected in the previous reader which is not always desired
behavior.

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message