Allow to configure a shard with no file based data location locking, closes #1535.

This commit is contained in:
Shay Banon 2011-12-12 15:04:54 +02:00
parent b0b379dc88
commit 775339d78a
1 changed files with 3 additions and 1 deletions

View File

@ -45,13 +45,15 @@ public abstract class FsDirectoryService extends AbstractIndexShardComponent imp
}
protected LockFactory buildLockFactory() throws IOException {
String fsLock = componentSettings.get("fs_lock", "native");
String fsLock = componentSettings.get("lock", componentSettings.get("fs_lock", "native"));
LockFactory lockFactory = NoLockFactory.getNoLockFactory();
if (fsLock.equals("native")) {
// TODO LUCENE MONITOR: this is not needed in next Lucene version
lockFactory = new NativeFSLockFactory();
} else if (fsLock.equals("simple")) {
lockFactory = new SimpleFSLockFactory();
} else if (fsLock.equals("none")) {
lockFactory = NoLockFactory.getNoLockFactory();
}
return lockFactory;
}