lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: java.io.tmpdir as lock dir .... once again
Date Wed, 03 Mar 2004 17:19:33 GMT
Michael Duval wrote:
  > I've hacked the code for the time being by updating FSDirectory and
> replaced all System.getProperty("java.io.tmpdir")
> calls with a call to a new method "getLockDir()".   This method checks 
> for a "lucene.lockdir" prop before the
> "java.io.tmpdir" prop giving the end user a bit more flexibility in 
> where locks are stored.

In general, I support this change.

> Here is the method:
> 
>  /** Allow flexible locking directories - Michael R. Duval 3/02/04 */
>  private String getLockDir() {
>        String lockDir;
> 
>        if ((lockDir = System.getProperty("lucene.lockdir")) == null)
>                return System.getProperty("java.io.tmpdir");
>        else
>                return  lockDir;
>  }

In particular, I have some quibbles.  The property should be named 
something like "org.apache.lucene.lockdir", not just "lucene.lockdir". 
And there's no reason to look it up each time: it can just be a static.

private static final String LOCK_DIR =
   System.getProperty("org.apache.lucene.lockdir",
                      System.getProperty("java.io.tmpdir"));

Doug

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


Mime
View raw message