Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 68561 invoked from network); 3 Oct 2009 10:13:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Oct 2009 10:13:40 -0000 Received: (qmail 54118 invoked by uid 500); 3 Oct 2009 10:13:39 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 54024 invoked by uid 500); 3 Oct 2009 10:13:39 -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 54016 invoked by uid 99); 3 Oct 2009 10:13:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2009 10:13:39 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of earwin@gmail.com designates 209.85.219.219 as permitted sender) Received: from [209.85.219.219] (HELO mail-ew0-f219.google.com) (209.85.219.219) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2009 10:13:30 +0000 Received: by ewy19 with SMTP id 19so1553266ewy.28 for ; Sat, 03 Oct 2009 03:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=6zDTKlRJJQrz8xwkmg/m0jwHueaEWoYMrDlqnh/tF+Y=; b=HQT2JZllkBGPIrS8dlj/X+R2F8XDGT0QXEHQbVKq1ezga9dECsGYTFJQu/v9kkoUNR XIgTkuPrmShQGu1hbs4GJlGLbnA5TaXPKE6q48/vrk8TCLUn1rZDyJpWhq0Hc6zUTBJ1 1WdkyXGA+1953XACxRPuAd83iEoetR8GW7vAI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=W4PgTZquWfInr9smvDNd1hdfvaFfFeX86FLKI3QNAn1/CvGgVoJGqjWjBjmzhTqUq1 ffmpas8nltXf+M9x52VEeKyxP26t3Fzs0/GehZw20vLdqowMOAJ7L1WZERvsN7lAlibg uZcXPQj/3eo5umPIyvtWWqROU1K3kyy6vNFNE= MIME-Version: 1.0 Received: by 10.216.17.195 with SMTP id j45mr578183wej.98.1254564789828; Sat, 03 Oct 2009 03:13:09 -0700 (PDT) In-Reply-To: <9ac0c6aa0910030235m4fa09700n76b15156c79252c5@mail.gmail.com> References: <4AC684B7.2040505@gmail.com> <59b3eb370910021625r3854c09dw3c280143aed87b1a@mail.gmail.com> <59b3eb370910021645l154f1ee9p14586927b93fbbef@mail.gmail.com> <9ac0c6aa0910021715w6c67c26fwcd5b25d80d7b7217@mail.gmail.com> <4AC698E4.1050606@gmail.com> <59b3eb370910021918h797027e8qf30761dd22e8f6e5@mail.gmail.com> <9ac0c6aa0910030235m4fa09700n76b15156c79252c5@mail.gmail.com> Date: Sat, 3 Oct 2009 14:13:09 +0400 Message-ID: <59b3eb370910030313j452585e5t1f465181462c46a4@mail.gmail.com> Subject: Re: Lucene 2.9 and deprecated IR.open() methods From: Earwin Burrfoot To: java-dev@lucene.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org >> Builder pattern allows you to switch concrete implementations as you >> please, taking parameters into account or not. > > We could also achieve this w/ static "factory" method. EG > IndexReader.open(IndexReader.Config) could switch between concrete > impls (it already does today). Yes, the choice of 'IW.create(IWSettings, Directory)' VS 'IWSettings.create(Directory)' is purely syntactical (with latter being more concise, imo), but I was comparing to 'new IW(Settings, Directory)'. >>> Call me old fashioned, but I like how the non constructor params are se= t >>> now. >> And what happens when you index some docs, change these params, index >> more docs, change params, commit? Let's throw in some threads? >> You either end up writing really hairy state control code, or just >> leave it broken, with "Don't change parameters after you start pumping >> docs through it!" plea covering your back somewhere in JavaDocs. >> If nothing else, having stuff 'final' keeps JIT really happy. > > This is a good point: are you allowed to change config settings after > creating your IndexWriter/Reader? > > Today it's ad hoc. > > EG IW does not allow you to swap out your deletion policy, because > it'd be a nightmare to implement. You also can't swap the analyzer. > But it does let you change your RAM buffer size, CFS or not, merge > factor, etc. We can remove that flexibility (I'm not sure it's > compelling), so we can make things final. You can't change read-only > after opening your IndexReader. I think it'd make sense to move away > from changing settings after construction... I've just remembered some horrible things: public void setMergeFactor(int mergeFactor) { getLogMergePolicy().setMergeFactor(mergeFactor); } Let's remove this "flexibility" too? > But: the "do we disallow changing config settings after construction?" > question is really orthogonal to the "what syntax do we use for > construction?" (builder vs config vs zillions-of-ctors). There's better syntax for both mutable and immutable approach, so it's not like these two questions are completely orthogonal. --=20 Kirill Zakharenko/=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB =D0=97=D0=B0=D1=85= =D0=B0=D1=80=D0=B5=D0=BD=D0=BA=D0=BE (earwin@gmail.com) Home / Mobile: +7 (495) 683-567-4 / +7 (903) 5-888-423 ICQ: 104465785 --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org