You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by eh...@apache.org on 2004/05/11 01:46:56 UTC

cvs commit: jakarta-lucene/src/java/org/apache/lucene/store FSDirectory.java Lock.java

ehatcher    2004/05/10 16:46:56

  Modified:    src/java/org/apache/lucene/store FSDirectory.java Lock.java
  Log:
  switch Lock to use a String instead of File
  
  Revision  Changes    Path
  1.28      +1 -1      jakarta-lucene/src/java/org/apache/lucene/store/FSDirectory.java
  
  Index: FSDirectory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/store/FSDirectory.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- FSDirectory.java	9 May 2004 12:41:47 -0000	1.27
  +++ FSDirectory.java	10 May 2004 23:46:56 -0000	1.28
  @@ -290,7 +290,7 @@
       // create a lock file
       final File lockFile = new File(lockDir, buf.toString());
   
  -    return new Lock(lockFile) {
  +    return new Lock(lockFile.getAbsolutePath()) {
         public boolean obtain() throws IOException {
           if (DISABLE_LOCKS)
             return true;
  
  
  
  1.11      +5 -6      jakarta-lucene/src/java/org/apache/lucene/store/Lock.java
  
  Index: Lock.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/store/Lock.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Lock.java	9 May 2004 13:50:03 -0000	1.10
  +++ Lock.java	10 May 2004 23:46:56 -0000	1.11
  @@ -18,7 +18,6 @@
   
   import org.apache.lucene.index.IndexWriter;
   
  -import java.io.File;
   import java.io.IOException;
   
   /** An interprocess mutex lock.
  @@ -36,10 +35,10 @@
    */
   public abstract class Lock {
     public static long LOCK_POLL_INTERVAL = 1000;
  -  private File lockFile = null;
  +  private String lockName = null;
     
  -  public Lock(File lockFile) {
  -    this.lockFile = lockFile;
  +  public Lock(String lockName) {
  +    this.lockName = lockName;
     }
   
     public Lock() {
  @@ -65,8 +64,8 @@
       while (!locked) {
         if (++sleepCount == maxSleepCount) {
           String s = "Lock obtain timed out";
  -        if (lockFile != null) {
  -            s += ", lock file =" + lockFile.getAbsolutePath();
  +        if (lockName != null) {
  +            s += ", lock name =" + lockName;
           }
           throw new IOException(s);
         }
  
  
  

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