lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: cvs commit: jakarta-lucene/src/test/org/apache/lucene ThreadSafetyTest.java
Date Mon, 05 May 2003 18:25:03 GMT
I was referring to an inspection of the lock file name by a person, not
programmatically.  Those who manage applications with a large number of
Lucene indices would probably benefit from being able to tell which
index each lock file corresponds to, just by looking at the lock file.
This would also allow easy use with UNIX commands such as `ls' and
`grep'.  I am working on something that will have hundreds and
hopefully thousands of Lucene indices, and if/when something goes wrong
and I need to manually clean up the locks, I would love to be able to
do:
rm /tmp/path-with-dashes-MyIndexName-write.lock

The way the code is done now I'll have to write a little class that
takes an index name and prints out what its lock file name would be,
using the code you sent.  Not difficult, but if the lock file name
looked more like /tmp/path-with-dashes-MyIndexName-write.lock, that
would not be necessary.

Otis




--- Doug Cutting <cutting@lucene.com> wrote:
> 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?
> 
> Doug
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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


Mime
View raw message