2.1 lock file name

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

2.1 lock file name

jmuguruza
Hi,

I updated my code to use 2.1 (IndexWriter deleting docs etc), and when
using native locks I still get a lock like this:
lucene-2361bf484af61abc81e6e7f412ad43af-n-write.lock
and when using SimpleFSLockFactory:
lucene-2361bf484af61abc81e6e7f412ad43af-write.lock

From the changes.txt:
9. LUCENE-771: The default location of the write lock is now the
    index directory, and is named simply "write.lock" (without a big
    digest prefix).

Not a big deal, just wondering if changes.txt is wrong or it refers to
some other lock file.

thanks for the 2.1 release to all,
javi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: 2.1 lock file name

Michael McCandless-2

On Tue, 20 Feb 2007 10:36:55 +0100, "jm" <[hidden email]> said:

> I updated my code to use 2.1 (IndexWriter deleting docs etc), and when
> using native locks I still get a lock like this:
> lucene-2361bf484af61abc81e6e7f412ad43af-n-write.lock
> and when using SimpleFSLockFactory:
> lucene-2361bf484af61abc81e6e7f412ad43af-write.lock

The defaulting only happens if FSDirectory.getDirectory() is called
without passing your own LockFactory.

If instead you create your own LockFactory and pass that in, then
FSDirectory won't change whichever lockDir you had specified to that
LockFactory.

If you want this same default behavior, but from your own created
LockFactory, you can do something like this:

  LockFactory lf = new NativeFSLockFactory(indexDir);
  Directory d = FSDirectory.getDirectory(indexDir, lf);
  lf.setLockPrefix(null);

That last line tells the lock factory that it's not necessary to use
that large digest prefix to differentiate locks (assuming
no other writer will be storing locks in this directory!).

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]