Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Michael Busch
I think we shouldn't discuss too many different things here. To begin I'd just like to introduce the IndexConfig class, that will hold the parameters we currently pass to the different IndexWriter constructors. If we later need to create different IndexWriter impls we can introduce a factory.

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Earwin Burrfoot
> I think AS is overkill for conveying configuration of IW/IR? Agree. > It's too cumbersome, I think, for something that ought to be simple. > I'd prefer a dedicated config class with strongly typed setters > exposed.  Of all the "pure syntax" options so far I'd still prefer the > traditional "con

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Mark Miller
Michael McCandless wrote: > I think AS is overkill for conveying configuration of IW/IR? > > Suddenly, instead of: > > cfg.setRAMBufferSizeMB(128.0) > > I'd have to do something like this? > > > cfg.addAttribute(IndexWriterRAMBufferSizeAttribute.class).setRAMBufferSize(128.0) > > It's too cumb

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Uwe Schindler
Hi Mike, > I think AS is overkill for conveying configuration of IW/IR? > > Suddenly, instead of: > > cfg.setRAMBufferSizeMB(128.0) > > I'd have to do something like this? > > > cfg.addAttribute(IndexWriterRAMBufferSizeAttribute.class).setRAMBufferSize > (128.0) > > It's too cumbersome, I

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Michael McCandless
I think AS is overkill for conveying configuration of IW/IR? Suddenly, instead of: cfg.setRAMBufferSizeMB(128.0) I'd have to do something like this? cfg.addAttribute(IndexWriterRAMBufferSizeAttribute.class).setRAMBufferSize(128.0) It's too cumbersome, I think, for something that ought to

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Uwe Schindler
> > See my second mail. The recently introduced Attributes and > AttributeSource > > would solve this. Each component just defines its attribute interface > and > > impl class and you pass in an AttributeSource as configuration. Then you > can > > do: > > > > AttributeSource cfg = new AttributeSour

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Earwin Burrfoot
On Mon, Oct 5, 2009 at 12:01, Uwe Schindler wrote: > Hi Marvin, > >> > Property names are always String, values any type (therefore >> Map). >> > With Java 5, integer props and so on are no "bad syntax" problem because >> of >> > autoboxing (no need to pass new Integer() or Integer.valueOf()). >>

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Uwe Schindler
Hi Marvin, > > Property names are always String, values any type (therefore > Map). > > With Java 5, integer props and so on are no "bad syntax" problem because > of > > autoboxing (no need to pass new Integer() or Integer.valueOf()). > > Argument validation gets to be a headache when you pass ar

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Marvin Humphrey
On Mon, Oct 05, 2009 at 08:27:20AM +0200, Uwe Schindler wrote: > Pass a Properties or Map to the ctor/open. The keys are predefined > constants. Maybe our previous idea of an IndexConfiguration class is a > subclass of HashMap with all the constants and some easy-to-use > setter methods for very o

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-05 Thread Uwe Schindler
> > On Sun, Oct 04, 2009 at 05:53:14AM -0400, Michael McCandless wrote: > > > > > 1 Do we prevent config settings from changing after creating an > > > IW/IR? > > > > Any settings conveyed via a settings object ought to be final if you > want > > pluggable index components. Otherwise, you ne

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-04 Thread Uwe Schindler
> On Sun, Oct 04, 2009 at 05:53:14AM -0400, Michael McCandless wrote: > > > 1 Do we prevent config settings from changing after creating an > > IW/IR? > > Any settings conveyed via a settings object ought to be final if you want > pluggable index components. Otherwise, you need some nightm

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-04 Thread Marvin Humphrey
On Sun, Oct 04, 2009 at 05:53:14AM -0400, Michael McCandless wrote: > 1 Do we prevent config settings from changing after creating an > IW/IR? Any settings conveyed via a settings object ought to be final if you want pluggable index components. Otherwise, you need some nightmarish notifica

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-04 Thread Marvin Humphrey
On Sun, Oct 04, 2009 at 03:04:13PM -0400, Mark Miller wrote: > Earwin Burrfoot wrote: > > As I stated in my last email, there's zero difference between > > settings+static factory and builder except for syntax. Cannot > > understand what Mark, Mike are arguing about. > > > Sounds like we are arg

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-04 Thread Mark Miller
Earwin Burrfoot wrote: > As I stated in my last email, there's zero difference between > settings+static factory and builder except for syntax. Cannot > understand what Mark, Mike are arguing about. > Sounds like we are arguing that we don't like the syntax then... > kill setting methods that de

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-04 Thread Earwin Burrfoot
As I stated in my last email, there's zero difference between settings+static factory and builder except for syntax. Cannot understand what Mark, Mike are arguing about. Right now I offer to do two things, in any possible way - eradicate as much broken/spahetti-like runtime state change from IW and

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-04 Thread Yonik Seeley
On Sun, Oct 4, 2009 at 5:53 AM, Michael McCandless wrote: >  1 Do we prevent config settings from changing after creating an >    IW/IR? > >  2 Do we use factory or ctor to create IW/IR? > > On #1, we are technically taking something away.  Are we sure no users > find the freedom to change IW sett

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-04 Thread Michael McCandless
I don't think we should do both. Suddenly, all code snippets (in javadocs, tutorials, email we all send, etc.) can be one pattern or the other, with each of us choosing based on our preference. Or, mixed. I think this just causes confusion. It'd suddenly become alot like differences of opinion

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-04 Thread Uwe Schindler
> >> The builder pattern and the config argument to a factory both have the > >> advantage that you can limit changes after creating an object. Some > >> things are just bad to change in mid-stream. The config argument is > >> nice in that you can pass it around to different stake holders, but >

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-04 Thread Michael Busch
On 10/4/09 3:31 AM, Mark Miller wrote: Ted Dunning wrote: The builder pattern and the config argument to a factory both have the advantage that you can limit changes after creating an object. Some things are just bad to change in mid-stream. The config argument is nice in that you can pass

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Mark Miller
Ted Dunning wrote: > > The builder pattern and the config argument to a factory both have the > advantage that you can limit changes after creating an object. Some > things are just bad to change in mid-stream. The config argument is > nice in that you can pass it around to different stake holder

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Ted Dunning
The builder pattern and the config argument to a factory both have the advantage that you can limit changes after creating an object. Some things are just bad to change in mid-stream. The config argument is nice in that you can pass it around to different stake holders, but the builder can be use

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Mark Miller
I think my preference is swayed by convention/simplicity. The way things are done now are just very intuitive for me. When I sit down to write some code with Lucene, I barley have to think or remember much. It all sticks. Its mostly all basic Java with few patterns. Now google has used some cool p

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Michael Busch
On 10/3/09 4:18 AM, Earwin Burrfoot wrote: Builder pattern allows you to switch concrete implementations as you please, taking parameters into account or not. Besides that there's no real difference. I prefer builder, but that's just me :) Why can't you do that with a factory that takes a

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Uwe Schindler
phi.de] > Sent: Saturday, October 03, 2009 2:00 PM > To: java-dev@lucene.apache.org > Subject: RE: Lucene 2.9 and deprecated IR.open() methods > > This seems to work, I have created some scripts that do the compilations > and > create a deprecation report and I start to fix in B

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Uwe Schindler
28213 Bremen > http://www.thetaphi.de > eMail: u...@thetaphi.de > > > > -Original Message- > > From: Uwe Schindler [mailto:u...@thetaphi.de] > > Sent: Saturday, October 03, 2009 12:33 PM > > To: java-dev@lucene.apache.org > > Subject: RE: Lucene 2.9 and depr

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Grant Ingersoll
On Oct 2, 2009, at 7:33 PM, Michael McCandless wrote: Sigh. The introduction of new but deprecated methods is silly. Is there some simple automated way to catch/prevent these? The proliferation of ctors/factory methods is a nightmare. Ah, so yet again, we are trying to work around a proble

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Uwe Schindler
[mailto:u...@thetaphi.de] > Sent: Saturday, October 03, 2009 12:33 PM > To: java-dev@lucene.apache.org > Subject: RE: Lucene 2.9 and deprecated IR.open() methods > > > From: Michael McCandless [mailto:luc...@mikemccandless.com] > > Sent: Saturday, October 03, 2009 12:29 PM &

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Uwe Schindler
> From: Michael McCandless [mailto:luc...@mikemccandless.com] > Sent: Saturday, October 03, 2009 12:29 PM > To: java-dev@lucene.apache.org > Subject: Re: Lucene 2.9 and deprecated IR.open() methods > > On Sat, Oct 3, 2009 at 6:25 AM, Uwe Schindler wrote: > > Now it get

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Michael McCandless
On Sat, Oct 3, 2009 at 6:25 AM, Uwe Schindler wrote: > Now it gets slower. After applying LUCENE-1944, you get >600 errors when > compiling tests :( > > We should have checked our tests in 2.9 that they only call deprecated > methods for BW compatibility. Sigh. Yes, going forward we should proba

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Uwe Schindler
nt: Saturday, October 03, 2009 12:21 PM > To: java-dev@lucene.apache.org > Subject: Re: Lucene 2.9 and deprecated IR.open() methods > > Right: 3.0 should be a fast turnaround w/ no further deprecations. > (And at your rate of progress Uwe it looks like it really *will* be > fast!)

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Michael Busch
ache.org Subject: Re: Lucene 2.9 and deprecated IR.open() methods There's also LUCENE-1698! Maybe we can change the policy. Now that 2.9 is out we should try to get to a conclusion. Michael On 10/3/09 11:54 AM, Michael McCandless wrote: Well, let's first get 3.0 out the door ;)

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Michael McCandless
/www.thetaphi.de > eMail: u...@thetaphi.de > > >> -Original Message- >> From: Michael Busch [mailto:busch...@gmail.com] >> Sent: Saturday, October 03, 2009 12:15 PM >> To: java-dev@lucene.apache.org >> Subject: Re: Lucene 2.9 and deprecated IR.open() methods >&g

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Uwe Schindler
Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Michael Busch [mailto:busch...@gmail.com] > Sent: Saturday, October 03, 2009 12:15 PM > To: java-dev@lucene.apache.org > Subject: Re: Lucene 2.9 and deprecated IR.open() methods > > The

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Michael Busch
-Original Message- From: Michael McCandless [mailto:luc...@mikemccandless.com] Sent: Saturday, October 03, 2009 11:35 AM To: java-dev@lucene.apache.org Subject: Re: Lucene 2.9 and deprecated IR.open() methods On Fri, Oct 2, 2009 at 10:18 PM, Earwin Burrfoot wrote: Call me old f

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Earwin Burrfoot
>> 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 cho

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Michael McCandless
>> Sent: Saturday, October 03, 2009 11:35 AM >> To: java-dev@lucene.apache.org >> Subject: Re: Lucene 2.9 and deprecated IR.open() methods >> >> On Fri, Oct 2, 2009 at 10:18 PM, Earwin Burrfoot wrote: >> >> Call me old fashioned, but I like how the non constructo

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Uwe Schindler
ss.com] > Sent: Saturday, October 03, 2009 11:35 AM > To: java-dev@lucene.apache.org > Subject: Re: Lucene 2.9 and deprecated IR.open() methods > > On Fri, Oct 2, 2009 at 10:18 PM, Earwin Burrfoot wrote: > >> Call me old fashioned, but I like how the non constructor params ar

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Michael McCandless
On Fri, Oct 2, 2009 at 10:18 PM, Earwin Burrfoot wrote: >> Call me old fashioned, but I like how the non constructor params are set >> 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 w

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-03 Thread Michael McCandless
On Fri, Oct 2, 2009 at 10:18 PM, Earwin Burrfoot wrote: > 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 con

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Mark Miller
Again - random opinion from left field - I've used guice and I like it a lot. Really cool stuff and I actually prefer it to Spring for injection. But still for some reason I'd hate to see Lucene start resembling anything in Guice. I'm not even taking the time to make arguments, so I don't e

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Mark Miller
On Oct 2, 2009, at 10:18 PM, Earwin Burrfoot wrote: Call me old fashioned, but I like how the non constructor params are set 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

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Earwin Burrfoot
> Call me old fashioned, but I like how the non constructor params are set > 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,

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Earwin Burrfoot
> Though what about required settings?  EG IW's builder must have > Directory, Analyzer.  Would we pass these as up-front args to the > initial builder? I'd try to keep required settings at minimum. The only one absolutely required, imho, is a Directory, and it's best to specify it in create() meth

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Mark Miller
Call me old fashioned, but I like how the non constructor params are set now. And for some reason I like a config object over a builder pattern for the required constructor params. Thats just me though. Michael McCandless wrote: > OK, I agree, using the builder approach looks compelling! > > Tho

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Michael McCandless
OK, I agree, using the builder approach looks compelling! Though what about required settings? EG IW's builder must have Directory, Analyzer. Would we pass these as up-front args to the initial builder? And shouldn't we still specify the version up-front so we can improve defaults over time wit

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Uwe Schindler
://www.thetaphi.de eMail: u...@thetaphi.de > -Original Message- > From: Michael McCandless [mailto:luc...@mikemccandless.com] > Sent: Saturday, October 03, 2009 1:33 AM > To: java-dev@lucene.apache.org > Subject: Re: Lucene 2.9 and deprecated IR.open() methods > > Sigh. The in

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Earwin Burrfoot
On Sat, Oct 3, 2009 at 03:29, Uwe Schindler wrote: >> It is also probably a good idea to move various settings methods from >> IW to that builder and have IW immutable in regards to configuration. >> I'm speaking of the likes of setWriteLockTimeout, setRAMBufferSizeMB, >> setMergePolicy, setMergeS

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Uwe Schindler
n: http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/ common/collect/MapMaker.html > > -Original Message- > > From: Michael McCandless [mailto:luc...@mikemccandless.com] > > Sent: Saturday, October 03, 2009 1:37 AM > > To: java-dev@lucene.apache.org > >

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Uwe Schindler
il: u...@thetaphi.de > -Original Message- > From: Michael McCandless [mailto:luc...@mikemccandless.com] > Sent: Saturday, October 03, 2009 1:37 AM > To: java-dev@lucene.apache.org > Subject: Re: Lucene 2.9 and deprecated IR.open() methods > > I think this would make sense.

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Michael McCandless
I think this would make sense... though, it'd be a shame if the "simple case" becomes overbearing. Maybe we can keep good defaults, but use Version to allow us to change them. So eg: new IndexWriter(new IndexWriter.Config(dir, analyzer, Version.LUCENE_29)); would be the "simple" case. Mike

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Michael McCandless
Sigh. The introduction of new but deprecated methods is silly. Is there some simple automated way to catch/prevent these? The proliferation of ctors/factory methods is a nightmare. Part of the story with IndexReader.open is the switch to readOnly IndexReaders. After the long back-compat discus

RE: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Uwe Schindler
> It is also probably a good idea to move various settings methods from > IW to that builder and have IW immutable in regards to configuration. > I'm speaking of the likes of setWriteLockTimeout, setRAMBufferSizeMB, > setMergePolicy, setMergeScheduler, setSimilarity. > > IndexWriter.Builder iwb =

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Earwin Burrfoot
It is also probably a good idea to move various settings methods from IW to that builder and have IW immutable in regards to configuration. I'm speaking of the likes of setWriteLockTimeout, setRAMBufferSizeMB, setMergePolicy, setMergeScheduler, setSimilarity. IndexWriter.Builder iwb = IndexWriter.

Re: Lucene 2.9 and deprecated IR.open() methods

2009-10-02 Thread Michael Busch
I was thinking lately about the large quantity of IndexWriter constructors and IndexReader open methods. I'm not sure if this has been proposed before, but what if we introduced new objects, e.g. IndexWriterConfig and IndexReaderConfig. They would contain getter/setter methods for all the diffe