Package org.apache.lucene.store
Class SingleInstanceLockFactory
- java.lang.Object
-
- org.apache.lucene.store.LockFactory
-
- org.apache.lucene.store.SingleInstanceLockFactory
-
public final class SingleInstanceLockFactory extends LockFactory
ImplementsLockFactoryfor a single in-process instance, meaning all locking will take place through this one instance. Only use thisLockFactorywhen you are certain all IndexWriters for a given index are running against a single shared in-process Directory instance.- See Also:
LockFactory
-
-
Constructor Summary
Constructors Constructor Description SingleInstanceLockFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LockobtainLock(Directory dir, String lockName)Return a new obtained Lock instance identified by lockName.
-
-
-
Method Detail
-
obtainLock
public Lock obtainLock(Directory dir, String lockName) throws IOException
Description copied from class:LockFactoryReturn a new obtained Lock instance identified by lockName.- Specified by:
obtainLockin classLockFactorylockName- name of the lock to be created.- Throws:
LockObtainFailedException- (optional specific exception) if the lock could not be obtained because it is currently held elsewhere.IOException- if any i/o error occurs attempting to gain the lock
-
-