You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/12/19 15:01:30 UTC

[jira] [Issue Comment Edited] (LUCENE-3631) Remove write access from SegmentReader and possibly move to separate class or IndexWriter/BufferedDeletes/...

    [ https://issues.apache.org/jira/browse/LUCENE-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172284#comment-13172284 ] 

Uwe Schindler edited comment on LUCENE-3631 at 12/19/11 2:01 PM:
-----------------------------------------------------------------

Patch looks nice.

One more thing: In my opinion, the whole synchronized stuff in SegmentCoreReaders can be removed (see LUCENE-3653) - all is final now, why synchronize? So LUCENE-3653 is a non-issue, when this is committed. Same applies to IR/DR/... - almost all synchronized methods can go away. And decRef, too, as it's already guarded by AtomicRef

And in my opinion incRef/decRef on IndexReaders is useless, too (or almost useless, except segmentreaders). As Shai said before, code like SearcherManager should reCount externaly with a separate interface/helperclass (that refcounts and on decRef to 0, it calls Closeable.close - so helper can work on any Closeable). But we should remove that in separate issue.
                
      was (Author: thetaphi):
    Patch looks nice.

One more thing: In my opinion, the whole synchronized stuff in SegmentCoreReaders can be removed (see LUCENE-3653) - all is final now, why synchronize? So LUCENE-3653 is a non-issue, when this is committed. Same applies to IR/DR/... - almost all synchronized methods can go away.

And in my opinion incRef/decRef on IndexReaders is useless, too (or almost useless, except segmentreaders). As Shai said before, code like SearcherManager should reCount externaly with a separate interface/helperclass (that refcounts and on decRef to 0, it calls Closeable.close - so helper can work on any Closeable). But we should remove that in future.
                  
> Remove write access from SegmentReader and possibly move to separate class or IndexWriter/BufferedDeletes/...
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3631
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3631
>             Project: Lucene - Java
>          Issue Type: Task
>          Components: core/index
>    Affects Versions: 4.0
>            Reporter: Uwe Schindler
>            Assignee: Michael McCandless
>         Attachments: LUCENE-3631.patch
>
>
> After LUCENE-3606 is finished, there are some TODOs:
> SegmentReader still contains (package-private) all delete logic including crazy copyOnWrite for validDocs Bits. It would be good, if SegmentReader itsself could be read-only like all other IndexReaders.
> There are two possibilities to do this:
> # the simple one: Subclass SegmentReader and make a RWSegmentReader that is only used by IndexWriter/BufferedDeletes/... DirectoryReader will only use the read-only SegmentReader. This would move all TODOs to a separate class. It's reopen/clone method would always create a RO-SegmentReader (for NRT).
> # Remove all write and commit stuff from SegmentReader completely and move it to IndexWriter's readerPool (it must be in readerPool as deletions need a not-changing view on an index snapshot).
> Unfortunately the code is so complicated and I have no real experience in those internals of IndexWriter so I did not want to do it with LUCENE-3606, I just separated the code in SegmentReader and marked with TODO. Maybe Mike McCandless can help :-)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org