Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 77653 invoked from network); 2 Jul 2008 09:18:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2008 09:18:01 -0000 Received: (qmail 18245 invoked by uid 500); 2 Jul 2008 09:17:55 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 18218 invoked by uid 500); 2 Jul 2008 09:17:55 -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 18207 invoked by uid 99); 2 Jul 2008 09:17:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2008 02:17:55 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shalinmangar@gmail.com designates 209.85.198.227 as permitted sender) Received: from [209.85.198.227] (HELO rv-out-0506.google.com) (209.85.198.227) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2008 09:17:04 +0000 Received: by rv-out-0506.google.com with SMTP id f6so352155rvb.5 for ; Wed, 02 Jul 2008 02:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=jwuoSfV4F/GPJI4J4WF/LzjkCPynF1/YEBtb4Pj1bps=; b=gS/D2jA3iXAZhpT5yiKj7L7x3+fIadR6xc294SCCq2ca6XYf/gYKgZTdhIv+MFx0M6 lRR25ti/VXSoRUf87W5fJ3TJPc+UJ/VFi6aiGuYMxOpD0XR40I+HOGgc9mNGLTdZaRD0 IO/ZSkjitkREcihpNpSezBzRQku4GYFpax7Jo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=KHcNaN1pgFO2JiBzqxzZd8c+E5y4qxs9GcCffRrZBK+JxaNxgBPM3rnfBvLcBqvhnA LcDMMLbU+IyyXNPftXQ3JOZUCrUGzENDgximTq/Fw2Tizdu3LzgzipW7OnjPnRydfUrl OljxlYvP6WDXxW0FT0YJZCSZECwHRKvr2ooZQ= Received: by 10.141.176.4 with SMTP id d4mr4294030rvp.14.1214990244966; Wed, 02 Jul 2008 02:17:24 -0700 (PDT) Received: by 10.140.178.17 with HTTP; Wed, 2 Jul 2008 02:17:24 -0700 (PDT) Message-ID: <69de18140807020217q2ab1c3c3se1cb33a4099f3a6c@mail.gmail.com> Date: Wed, 2 Jul 2008 14:47:24 +0530 From: "Shalin Shekhar Mangar" To: java-user@lucene.apache.org Subject: Re: IndexDeletionPolicy and optimized indices In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <69de18140807010347s6269fea5r12c3212e0ec0a12a@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi Michael, Thanks for the response. Looking at the general way the filenames are organized: IndexCommit.getFileNames() without optimize (after IW.close()) [segments_4, _0.cfs, _1.cfs, _2.cfs] IndexCommit.getFileNames() after optimize+close [segments_5, _4.cfs] We can compare the latest commit point's files with the previous commit point's files and if the number of .cfs files have decreased (or equal) (with a +1 in generation number), can we reliably say if an optimize has happened? On Tue, Jul 1, 2008 at 5:44 PM, Michael McCandless wrote: > > You're right IndexCommit doesn't know that it represents an optimized index. > > Likewise, IndexCommit doesn't know other "semantic" things about the index, eg, you've just called expungeDeletes, or, you just finished adding batch X of documents to the index, etc. > > Also, realize that with autoCommit=false (to be the only choice in 3.0), no commit will be done after an optimize. Ie you have to call commit() or close() explicitly to make it a commit. > > I think the simplest general approach to "know" which commit points represent "interesting" times to the application would be to call IW.optimize() then IW.commit() (if you are using trunk) or just IW.close(), then look at the last IndexCommit passed to your deletion policy's onCommit() and record yourself that this commit was the result of an optimize. > > Mike > > Shalin Shekhar Mangar wrote: > >> Hi, >> >> I'm implementing a custom IndexDeletionPolicy. An IndexCommit object >> does not have any information whether it's index is optimized or not. >> How can a IndexDeletionPolicy know which IndexCommit instances >> corresponded to optimized indices? >> >> -- >> Regards, >> Shalin Shekhar Mangar. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-user-help@lucene.apache.org >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > -- Regards, Shalin Shekhar Mangar. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org