Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 15003 invoked from network); 10 Mar 2011 16:52:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Mar 2011 16:52:25 -0000 Received: (qmail 10081 invoked by uid 500); 10 Mar 2011 16:52:24 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 10007 invoked by uid 500); 10 Mar 2011 16:52:24 -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 10000 invoked by uid 99); 10 Mar 2011 16:52:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Mar 2011 16:52:24 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.213.176] (HELO mail-yx0-f176.google.com) (209.85.213.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Mar 2011 16:52:18 +0000 Received: by yxd5 with SMTP id 5so1078165yxd.35 for ; Thu, 10 Mar 2011 08:51:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.190.232 with SMTP id e68mr1395734yhn.187.1299775916894; Thu, 10 Mar 2011 08:51:56 -0800 (PST) Received: by 10.236.108.166 with HTTP; Thu, 10 Mar 2011 08:51:56 -0800 (PST) In-Reply-To: References: <5F3CD6BBA17147A99427BCEB4065ACA0@gmail.com> Date: Thu, 10 Mar 2011 11:51:56 -0500 Message-ID: Subject: Re: IndexWriter#setRAMBufferSizeMB removed in trunk From: Michael McCandless To: dev@lucene.apache.org Cc: Shai Erera Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Mar 10, 2011 at 8:23 AM, Shai Erera wrote: > IWC simplified IW creation - now there is only one ctor, where before there > were multiple ones, and some settings could only be changed after IW was > created. > > With IWC, our code is (can become) simpler -- e.g. RAM buffer size, if > specified up front is one thing, but if it's dynamic, we need to have code > which dynamically increases or decreases it. Increasing is not the problem, > but decreasing requires special code that flushes and discards the extra > memory. Maybe the code already exists, I haven't checked. Actually IW handles this (RAM buffer grows or shrinks) today, or it did before the IWC change. Though I'm not sure it provoked a flush immediately (ie, it was probably on the next add/update/delete call that the flush happened); we should fix that. > I don't like setters that are all over the place either. Having said that > though, today the setters are inconsistent -- some are 'static' (meaning, > cannot change after IW created) while some are dynamic, such as the > MergePolicy settings. Because MP responds to those setters. > > One thing we can do is keep all the setters in IWC and have IW pass itself > to IWC after creation. Then, we can modify certain settings in IWC to notify > IW of these changes. But it's complicated. +1 -- I think this is the best option? Ie, we leave all setters/getters in IWC, but we make it clear (in javadocs) which settings are "live" and which must be done before init'ing the IW. If we want to be anal about it we can throw IllegalStateExc if you try to change a static setting after IW has bound to the IWC. -- Mike http://blog.mikemccandless.com --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org