lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Tucker" <m...@jivesoftware.com>
Subject RE: Locking problems
Date Tue, 11 Jun 2002 14:58:53 GMT
Stefan,

I assume you mean disabling the lock file? This is pretty easy to do by
editing the source code. Just edit FSDirectory.java and replace the
current makeLock method with the following:

-------------------------------------
  public final Lock makeLock(String name) {
    final File lockFile = new File(directory, name);
    return new Lock() {
	public boolean obtain() throws IOException {
          // DISABLE ALL LOCKS
          return true;
          //if (Constants.JAVA_1_1) return true;    // locks disabled in
jdk 1.1
          //return lockFile.createNewFile();
	}
	public void release() {
        // DISABLE ALL LOCKS
        return;
        //  if (Constants.JAVA_1_1) return;         // locks disabled in
jdk 1.1
	  //lockFile.delete();
	}
	public String toString() {
	  return "Lock@" + lockFile;
	}
      };
  }
--------------------------------------

The "real" way to fix this will be to make the use of lock files
configurable.

Regards,
Matt

> -----Original Message-----
> From: stefan@blues.intra.polopoly.com 
> [mailto:stefan@blues.intra.polopoly.com] On Behalf Of Stefan 
> Bergstrand
> Sent: Tuesday, June 11, 2002 10:40 AM
> To: Lucene Developer
> Subject: Locking problems
> 
> 
> 
> 
> When I recently mentioned that it would be nice to be able to 
> search without locking the index, I got the answer "It's on 
> the TODO-list".
> 
> I'm glad that it has a good chance to be fixed, but to us it 
> has become a really big problem.
> 
> This is our case:
> 
> The indexes are stored on a disk that is NFS-mounted to a 
> number of load-balanced hosts, on which the searching is 
> performed. The locking mechanism prevents us not only from 
> mounting the disk read-only, which would have been very nice, 
> but also from searching the same index concurrently. Thus, we 
> get performance as if we had just one host. Which would be 
> single-thread, too. 
> 
> So, I would like to know:
> 
> * Does anyone know when the fix could made?
> 
> * Is there a plan on how to fix it? (If there is, it would be better
>   if I fixed it that way instead of figuring out a kludge of my own.)
> 
> /Stefan B 
> 
> 
> -- 
> ---------------------------
> Stefan Bergstrand
> Polopoly - Cultivating the information garden
> Kungsgatan 88, SE-112 27 Stockholm, SWEDEN
> Ph:   +46 8 506 782 67
> Cell: +46 704 47 82 67
> stefan.bergstrand@polopoly.com, http://www.polopoly.com
> 
> --
> To unsubscribe, e-mail:   
> <mailto:lucene-dev-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:lucene-dev-help@jakarta.apache.org>
> 


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


Mime
View raw message