Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 35660 invoked from network); 4 Dec 2008 22:44:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 22:44:45 -0000 Received: (qmail 20874 invoked by uid 500); 4 Dec 2008 22:44:51 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 20611 invoked by uid 500); 4 Dec 2008 22:44:50 -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 20600 invoked by uid 99); 4 Dec 2008 22:44:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 14:44:50 -0800 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 glen.newton@gmail.com designates 209.85.200.172 as permitted sender) Received: from [209.85.200.172] (HELO wf-out-1314.google.com) (209.85.200.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 22:43:22 +0000 Received: by wf-out-1314.google.com with SMTP id 28so4281000wfc.20 for ; Thu, 04 Dec 2008 14:44:10 -0800 (PST) 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=3xFfcwC+dhJuZFo/Eo2Nzwl8DxKx/dx/trWi5B8cn30=; b=aU9yBnqsw+K3SHn4olJna+1MYGFclXg6uXzPFdciJnAig8VeTSv1v62PgmA2wD6V+3 tp/SMQy/711sxIN6wwH8YX6F/g7kA/mGQuOvaFAWzL/ksr/ZsofJidyEBfX+tsgCJvzw PIw8by9NGW+ANgEqF0p7kD4fIOTH2jSDhkYx4= 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=ss2ffj4GLHh9YU/aFDJipCdSJs0ptiu/2zvJmXRQbQmA3LiHATMsb55CuOLL0wgYWz jpXoJEihGvqvbpzQ0dGakTdvBYtH+Sy8DbhnV5cmiLKM3yLVJq7mhBZWlqN1zKc7SZrx +wm0L9uhflDDz8+QqwjPQG5joMvKCoguNS3wY= Received: by 10.142.156.2 with SMTP id d2mr6116161wfe.102.1228430650649; Thu, 04 Dec 2008 14:44:10 -0800 (PST) Received: by 10.143.40.11 with HTTP; Thu, 4 Dec 2008 14:44:10 -0800 (PST) Message-ID: <5e76f3840812041444kc22c7dct94f4eed96d669b41@mail.gmail.com> Date: Thu, 4 Dec 2008 17:44:10 -0500 From: "Glen Newton" To: java-user@lucene.apache.org Subject: Re: NIOFSDirectory In-Reply-To: <8837fb770812041426l6fb871fcq8a1a8cc927875e3f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8837fb770812041311s120769edta61416d86d158463@mail.gmail.com> <5e76f3840812041332y6420786dp80463d3733bf69ca@mail.gmail.com> <8837fb770812041408x48e933bck2e5257dccd8d65df@mail.gmail.com> <8837fb770812041426l6fb871fcq8a1a8cc927875e3f@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Am I missing something here? Why not use: IndexWriter writer = new IndexWriter(NIOFSDirectory.getDirectory(new File(filename), analyzer, true); Another question: is NIOFSDirectory to be used with IndexWriter? If no, could someone explain? thanks, -glen 2008/12/4 John Wang : > Thanks! > -John > > On Thu, Dec 4, 2008 at 2:16 PM, Yonik Seeley wrote: > >> Details in the bug: >> https://issues.apache.org/jira/browse/LUCENE-1451 >> >> Use this constructor to create an instance of NIODirectory: >> >> /** Create a new NIOFSDirectory for the named location. >> * >> * @param path the path of the directory >> * @param lockFactory the lock factory to use, or null for the default. >> * @throws IOException >> */ >> public NIOFSDirectory(File path, LockFactory lockFactory) throws >> IOException { >> super(path, lockFactory); >> } >> >> -Yonik >> >> >> On Thu, Dec 4, 2008 at 5:08 PM, John Wang wrote: >> > That does not help. The File/path is not stored with the instance. It is >> in >> > a map FSDirectory keeps statically. Should subclasses of FSDirectory be >> > modifying the map? >> > This is not a question about how to subclass or customize FSDirectory. >> This >> > is more on how to use NIOFSDirectory class. I am hoping for a simply >> answer, >> > is what I am doing (setting the class name statically on system property) >> > the right way? >> > >> > -John >> > >> > On Thu, Dec 4, 2008 at 2:00 PM, Yonik Seeley wrote: >> > >> >> On Thu, Dec 4, 2008 at 4:32 PM, Glen Newton >> wrote: >> >> > Sorry....what version are we talking about? :-) >> >> >> >> The current development version of Lucene allows you to directly >> >> instantiate FSDirectory subclasses. >> >> >> >> -Yonik >> >> >> >> >> >> > thanks, >> >> > >> >> > Glen >> >> > >> >> > 2008/12/4 Yonik Seeley : >> >> >> On Thu, Dec 4, 2008 at 4:11 PM, John Wang >> wrote: >> >> >>> Hi guys: >> >> >>> We did some profiling and benchmarking: >> >> >>> >> >> >>> The thread contention on FSDIrectory is gone, and for the set of >> >> queries >> >> >>> we are running, performance improved by a factor of 5 (to be >> >> conservative). >> >> >>> >> >> >>> Great job, this is awesome, a simple change and made a huge >> >> difference. >> >> >>> >> >> >>> To get NIOFSDirectory installed, I didn't find any documentation >> >> >>> (doesn't mean there aren't any), after reading the code, I resorted >> to: >> >> >>> >> >> >>> static >> >> >>> { >> >> >>> >> >> >>> >> >> >> System.setProperty("org.apache.lucene.FSDirectory.class",NIOFSDirectory.class.getName()); >> >> >>> } >> >> >>> I am sure this is not the intended usage, as this is really ugly. >> >> What is >> >> >>> the suggested usage? >> >> >> >> >> >> Instantiate NIOFSDirectory directly and pass it to the >> >> IndexReader.open() >> >> >> >> >> >> -Yonik >> >> >> >> >> >> --------------------------------------------------------------------- >> >> >> 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 >> >> > >> >> > >> >> >> >> --------------------------------------------------------------------- >> >> 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 >> >> > -- - --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org