lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <dan...@nuix.com.au>
Subject Re: API for setting lock directory
Date Wed, 29 Mar 2006 05:32:18 GMT
Otis Gospodnetic wrote:
> This was the ooooold behaviour in Lucene.  You may want to check the
> ML archives to see why the lock was moved to temp dir by default, I
> remember there being some discussion around that. This might have
> been....2 years ago?

To answer my own question, I've just discovered that LOCK_DIR is public 
on FSDirectory, and that setting it to null makes it use the index 
directory as the means of storage.

My instant guess as to why it's not stored in the text index itself, is 
that it might have been done to support read-only text indexes.  (Or 
perhaps not... a read-only directory doesn't have to worry so much about 
getting into inconsistencies.  If you can't modify files, you can't 
cause conflicts.)

I've also discovered that Lucene is using createNewFile() to perform 
locking (the JavaDoc for said method says that it shouldn't be used for 
locking.)  Luckily the makeLock() method is overridable so we could 
easily avoid that issue without modifying Lucene.

Daniel


-- 
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://www.nuix.com.au/                        Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message