Package org.apache.lucene.store
Class BaseDirectory
- java.lang.Object
-
- org.apache.lucene.store.Directory
-
- org.apache.lucene.store.BaseDirectory
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
CompoundFileDirectory
,FileSwitchDirectory
,FSDirectory
,RAMDirectory
public abstract class BaseDirectory extends Directory
Base implementation for a concreteDirectory
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.store.Directory
Directory.IndexInputSlicer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearLock(java.lang.String name)
Attempt to clear (forcefully unlock and remove) the specified lock.LockFactory
getLockFactory()
Get the LockFactory that this Directory instance is using for its locking implementation.Lock
makeLock(java.lang.String name)
Construct aLock
.void
setLockFactory(LockFactory lockFactory)
Set the LockFactory that this Directory instance should use for its locking implementation.-
Methods inherited from class org.apache.lucene.store.Directory
close, copy, createOutput, createSlicer, deleteFile, fileExists, fileLength, getLockID, listAll, openInput, sync, toString
-
-
-
-
Method Detail
-
makeLock
public Lock makeLock(java.lang.String name)
Description copied from class:Directory
Construct aLock
.
-
clearLock
public void clearLock(java.lang.String name) throws java.io.IOException
Description copied from class:Directory
Attempt to clear (forcefully unlock and remove) the specified lock. Only call this at a time when you are certain this lock is no longer in use.
-
setLockFactory
public void setLockFactory(LockFactory lockFactory) throws java.io.IOException
Description copied from class:Directory
Set the LockFactory that this Directory instance should use for its locking implementation. Each * instance of LockFactory should only be used for one directory (ie, do not share a single instance across multiple Directories).- Specified by:
setLockFactory
in classDirectory
- Parameters:
lockFactory
- instance ofLockFactory
.- Throws:
java.io.IOException
-
getLockFactory
public LockFactory getLockFactory()
Description copied from class:Directory
Get the LockFactory that this Directory instance is using for its locking implementation. Note that this may be null for Directory implementations that provide their own locking implementation.- Specified by:
getLockFactory
in classDirectory
-
-