Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@www.apache.org Received: (qmail 53729 invoked from network); 8 Aug 2004 12:44:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 8 Aug 2004 12:44:01 -0000 Received: (qmail 3407 invoked by uid 500); 8 Aug 2004 12:44:01 -0000 Delivered-To: apmail-jakarta-lucene-dev-archive@jakarta.apache.org Received: (qmail 2978 invoked by uid 500); 8 Aug 2004 12:43:59 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 2965 invoked by uid 99); 8 Aug 2004 12:43:59 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO,SPF_HELO_PASS X-Spam-Check-By: apache.org Received: from [212.227.126.187] (HELO moutng.kundenserver.de) (212.227.126.187) by apache.org (qpsmtpd/0.27.1) with ESMTP; Sun, 08 Aug 2004 05:43:55 -0700 Received: from [212.227.126.209] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1Btn1l-0006Gz-00 for lucene-dev@jakarta.apache.org; Sun, 08 Aug 2004 14:43:53 +0200 Received: from [62.245.160.78] (helo=detego-software.de) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1Btn1l-0007J3-00 for lucene-dev@jakarta.apache.org; Sun, 08 Aug 2004 14:43:53 +0200 Message-ID: <41161F3D.9040205@detego-software.de> Date: Sun, 08 Aug 2004 14:40:29 +0200 From: Christoph Goller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031009 X-Accept-Language: de, en-us, en, de-at MIME-Version: 1.0 To: Lucene Developers List Subject: Re: IndexWriter.getUseCompoundFile is confusing References: <200408061201.38126.daniel.naber@t-online.de> <41152FC3.7070501@earthlink.net> In-Reply-To: <41152FC3.7070501@earthlink.net> X-Enigmail-Version: 0.76.7.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:12f525e90d51bb735119ab4626f6800d X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Dmitry Serebrennikov wrote: > Daniel Naber wrote: > >> Hi, >> >> I open an index with create=false so I can use addIndexes() on that >> index. I want to use the existing setting for useCompoundFile of that >> index. But getUseCompoundFile() will always return true, as it just >> returns what one has set with setUseCompoundFile() or the default. >> >> > Hi Daniel, > > This setting really controls what should happen when new merge occur, > not what has happened in the index in the past... But perhaps there > should be a way to find out what format a given index uses as well? For > optimized indexes, this would be unumbigious, and for multi-segment > indexes, perhaps it would be enough to ask if at least one segment uses > compound files or if at least one segment uses multi-file format? > > Actually, there is already a method on SegmentReader called > usesCompoundFile() which will return a boolean about that segment. There > is also a static method there that takes a SegmentInfo object. Perhaps > IndexWriter's value should be initialized to true only if create is true > or if at least one existing segment already uses compound files? Would > that help? > >> I suggest to just remove getUseCompoundFile(). Asking for a value >> which one set just before with setUseCompoundFile() doesn't make much >> sense, and asking for the default also doesn't make much sense either >> I think. Any opinions/objections? >> >> > Well, I think from the design and testability point of view, any setter > should have a corresponding getter. In other words, if you can do > something to an object from the outside, you should be able to verify > that it has been done. Perhaps we need to change the initialization > behavior, but I think the method should stay. I also think that there should be a getter and a setter. However, the JavaDoc could be improved to make clear that useCompoundFile does not give information about the current property of the index, but determines behavior of the writer and thus future propertis of the index. We could add public methods to IndexReader which give information about the index such as: boolean usesCompoundFile(): true only if all segments use compound files boolean hasChangedNorms() boolean isOptimized() Christoph --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org