lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Duval <du...@aps.org>
Subject Re: java.io.tmpdir as lock dir .... once again
Date Wed, 03 Mar 2004 20:09:33 GMT

I agree with both the property name change and also making it static.

Mike

Doug Cutting wrote:

> 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
>



---------------------------------------------------------------------
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