lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (Updated) (JIRA)" <>
Subject [jira] [Updated] (LUCENE-3606) Make IndexReader really read-only in Lucene 4.0
Date Fri, 09 Dec 2011 09:56:40 GMT


Uwe Schindler updated LUCENE-3606:

    Attachment: LUCENE-3606-deprecations3x.patch

Here a patch that deprecates the removed methods in 3x:
- delete*, undeleteAll
-, readonly,...)
- adds missing non-readOnly
- for now I also deprecated setNorm(). If I would not deprecate it, it would be inconsistent,
as setNorm only works with readOnly=false - but you can never call that wthout a deprecation
warning. I think we should leave setNorm deprecated.

I did not fix the tests to not use deprecated readOnly=true! :(

I found a serious API glitch in 3.x with openIfChanged:
- the base class defines doOpenIfChanged(boolean readOnly), but MultiReader and ParallelReader
"override" this method with a signature doOpenIfChanged(doClone) and missing @Override. This
makes consumers calling IR.openIfChanged(boolean readOnly) do the wrong thing. Instead they
should get UOE like for the other unimplemented doOpenIfChanged methods in MR and PR.
> Make IndexReader really read-only in Lucene 4.0
> -----------------------------------------------
>                 Key: LUCENE-3606
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Task
>          Components: core/index
>    Affects Versions: 4.0
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 4.0
>         Attachments: LUCENE-3606-deprecations3x.patch, LUCENE-3606-hideMethodAgain.patch,
> As we change API completely in Lucene 4.0 we are also free to remove read-write access
and commits from IndexReader. This code is so hairy and buggy (as investigated by Robert and
Mike today) when you work on SegmentReader level but forget to flush in the DirectoryReader,
so its better to really make IndexReaders readonly.
> Currently with IndexReader you can do things like:
> - delete/undelete Documents -> Can be done by with IndexWriter, too (using deleteByQuery)
> - change norms -> this is a bad idea in general, but when we remove norms at all and
replace by DocValues this is obsolete already. Changing DocValues should also be done using
IndexWriter in trunk (once it is ready)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message