Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B21F7161 for ; Mon, 19 Dec 2011 11:47:56 +0000 (UTC) Received: (qmail 34933 invoked by uid 500); 19 Dec 2011 11:47:55 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 34740 invoked by uid 500); 19 Dec 2011 11:47:55 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 34728 invoked by uid 99); 19 Dec 2011 11:47:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Dec 2011 11:47:55 +0000 X-ASF-Spam-Status: No, hits=-2002.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Dec 2011 11:47:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 99AC711B9A6 for ; Mon, 19 Dec 2011 11:47:30 +0000 (UTC) Date: Mon, 19 Dec 2011 11:47:30 +0000 (UTC) From: "Michael McCandless (Updated) (JIRA)" To: dev@lucene.apache.org Message-ID: <1835677143.25935.1324295250630.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <841473565.57959.1323431680106.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (LUCENE-3631) Remove write access from SegmentReader and possibly move to separate class or IndexWriter/BufferedDeletes/... MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael McCandless updated LUCENE-3631: --------------------------------------- Attachment: LUCENE-3631.patch Patch, making SegmentReader fully read-only; it's much simpler now! I cutover to simple ctors (3 of them, depending on how the core/del docs are set) instead of static get methods. I removed clone() from all IR impls and made final IR.clone() that throws UOE. Cloning no longer makes sense since all IRs are read-only... I pushed all "pending deletes" tracking inside IW, and changed the readerPool to store a map of SegmentInfo to the "state" that IW needs to track for each segment (open reader for searching, open reader for merging, live docs and pending delete count). I think it's ready... > 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