Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 62715 invoked from network); 15 May 2006 04:10:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 May 2006 04:10:10 -0000 Received: (qmail 25260 invoked by uid 500); 15 May 2006 04:10:03 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 25212 invoked by uid 500); 15 May 2006 04:10:02 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 25200 invoked by uid 99); 15 May 2006 04:10:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 May 2006 21:10:01 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [169.229.70.167] (HELO rescomp.berkeley.edu) (169.229.70.167) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 May 2006 21:10:00 -0700 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id 2BAC65B780; Sun, 14 May 2006 21:09:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id 23A337F403 for ; Sun, 14 May 2006 21:09:33 -0700 (PDT) Date: Sun, 14 May 2006 21:09:33 -0700 (PDT) From: Chris Hostetter To: java-user@lucene.apache.org Subject: Re: IndexUpdateListener In-Reply-To: <1147628914.4931.115.camel@localhost> Message-ID: References: <1147525928.4931.17.camel@localhost> <1147617149.4931.106.camel@localhost> <1147628914.4931.115.camel@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N : As deep as possible. : : All the user would need to know is Directory.getListerners() I don't really get what the point of such a low level callback mechanism would be ... do you have uses cases where you're really going to want to know every time someone uses a Directory object to do something (create a file, open a file, createa lock, etc..) THe only usefull callback/listner abstractions i can think of are when you want to know if someone has finished with a set of changes -- wether that change is adding one document, deleting one document, or adding/deleting a whole bunch of documents isn't really relevent, you still want to know that a complete "set" has been modified, so you aren't constantly flushing caches or reopening IndexReaders everytime a single document is added. which means the lowerst level i can imagine a usefull listener hook being added is hte IndexReader/IndexWriter/IndexModifier APIs -- but even then what matters isn't the individual method calls, it's the opening and closing of the objects themselves -- which means either subclassing them so that when you construct them you tell them who to notify when they get closed, or it means that you have some factory for creating them and that factory keeps track of it ... Solr works in the later way. Anyway I slice it, I can't think of any use cases where it would make sense to register listeners as low as the IndexReader -- let alone down at the directory. Personally: I think the best way to be "notified" that the index is changed at a really fine level of granularity is to just poll on IndexReader.getCurrentVersion (and compare with IndexReader.getVersion) ... that way you don't have to worry that you'll get messages to often -- you can poll at whatever rate you want. -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org