Package org.apache.lucene.store
Class FSLockFactory
java.lang.Object
org.apache.lucene.store.LockFactory
org.apache.lucene.store.FSLockFactory
- Direct Known Subclasses:
NativeFSLockFactory,SimpleFSLockFactory
Base class for file system based locking implementation. This class is explicitly checking that
the passed
Directory is an FSDirectory.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final FSLockFactoryReturns the default locking implementation for this platform.protected abstract LockobtainFSLock(FSDirectory dir, String lockName) Implement this method to obtain a lock for a FSDirectory instance.final LockobtainLock(Directory dir, String lockName) Return a new obtained Lock instance identified by lockName.
-
Constructor Details
-
FSLockFactory
public FSLockFactory()
-
-
Method Details
-
getDefault
Returns the default locking implementation for this platform. This method currently returns alwaysNativeFSLockFactory. -
obtainLock
Description copied from class:LockFactoryReturn a new obtained Lock instance identified by lockName.- Specified by:
obtainLockin classLockFactory- Parameters:
lockName- name of the lock to be created.- Throws:
IOException- if any i/o error occurs attempting to gain the lock
-
obtainFSLock
Implement this method to obtain a lock for a FSDirectory instance.- Throws:
IOException- if the lock could not be obtained.
-