lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: cvs commit: jakarta-lucene/src/test/org/apache/lucene
Date Mon, 05 May 2003 17:57:40 GMT
Otis Gospodnetic wrote:
> I noticed MD5 stuff, which makes me think the names won't be human
> friendly, but I have not tried running the code yet.
> Wouldn't it be better to throw in the name of the index in the lock
> file name?

When would you need to know the index name given a lock file?

The lock files are named (on unix) /tmp/lucene-XXXX.lock, where XXXX is 
a hex MD5-hash derived from the index directory and the lock name.

If one wished to know which lock file in /tmp corresponded to a given 
index directory d, then one can see the path name with, e.g.:

   FSDirectory.getDirectory(d, false).makeLock("write.lock").toString()

The best thing to do, however, is to use the IndexReader isLocked() and 
unlock() static methods.  Are these not sufficient?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message