Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 5194 invoked from network); 2 Nov 2007 14:44:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Nov 2007 14:44:16 -0000 Received: (qmail 15096 invoked by uid 500); 2 Nov 2007 14:44:03 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 14438 invoked by uid 500); 2 Nov 2007 14:44:01 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 14427 invoked by uid 99); 2 Nov 2007 14:44:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2007 07:44:01 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2007 14:44:32 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CD199714233 for ; Fri, 2 Nov 2007 07:43:50 -0700 (PDT) Message-ID: <23042479.1194014630837.JavaMail.jira@brutus> Date: Fri, 2 Nov 2007 07:43:50 -0700 (PDT) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-743) IndexReader.reopen() In-Reply-To: <2046210.1165877241108.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539598 ] Michael McCandless commented on LUCENE-743: ------------------------------------------- OK, reviewed the latest patch: * In this code: {code} // singleNormFile means multiple norms share this file if (fileName.endsWith("." + IndexFileNames.NORMS_EXTENSION)) { clone.singleNormStream = d.openInput(fileName, readBufferSize); } {code} I think the comment should be removed (it doens't apply) and also won't this incorrectly open the singleNormStream more than once if more than one field does not have separate norms? I think you should init that to null and then only reopen it, once, if it's still null? * In MultiSegmentReader, the logic that copies over unchanged norms from the old norms cache can be simplified. I think you can just look up the old Norm instance & the new Norm instance and if they are == then you can copy bytes over? This would also let you remove "sharedNorms" entirely which is good because it's not a just a boolean thing anymore since some Norm instances are shared and some aren't. * I think you also need to override decRef (and add decRefReaderNotNorms) to SegmentReader? Because now there is a mismatch: incRef incr's the Norm RC's, but, decRef does not. So I think norms are not getting closed? I think we should modify the "assertReaderClosed()" in the unit test to verify (when appropriate) that also the RC of all Norm instances is also 0 (ie assertTrue(SR.normsClosed())). Then, make sure SR calls referencedSegmentReader.decRefReaderNotNorms instead of decRef. I think you then don't need to track "closedNorms" boolean, at all. You simply always decRef the norms whenever SR.decRef is called. The doCloseUnsharedResources is still needed to close the singleNormStream. > IndexReader.reopen() > -------------------- > > Key: LUCENE-743 > URL: https://issues.apache.org/jira/browse/LUCENE-743 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Reporter: Otis Gospodnetic > Assignee: Michael Busch > Priority: Minor > Fix For: 2.3 > > Attachments: IndexReaderUtils.java, lucene-743-take2.patch, lucene-743-take3.patch, lucene-743-take4.patch, lucene-743-take5.patch, lucene-743.patch, lucene-743.patch, lucene-743.patch, MyMultiReader.java, MySegmentReader.java, varient-no-isCloneSupported.BROKEN.patch > > > This is Robert Engels' implementation of IndexReader.reopen() functionality, as a set of 3 new classes (this was easier for him to implement, but should probably be folded into the core, if this looks good). -- 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