Package org.apache.lucene.store
Class BaseDirectory
java.lang.Object
org.apache.lucene.store.Directory
org.apache.lucene.store.BaseDirectory
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
CompoundFileDirectory
,FileSwitchDirectory
,FSDirectory
,RAMDirectory
Base implementation for a concrete
Directory
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.store.Directory
Directory.IndexInputSlicer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected LockFactory
Holds the LockFactory instance (implements locking for this Directory instance). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Attempt to clear (forcefully unlock and remove) the specified lock.protected final void
Get the LockFactory that this Directory instance is using for its locking implementation.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
-
Field Details
-
isOpen
protected volatile boolean isOpen -
lockFactory
Holds the LockFactory instance (implements locking for this Directory instance).
-
-
Constructor Details
-
BaseDirectory
protected BaseDirectory()Sole constructor.
-
-
Method Details
-
makeLock
Description copied from class:Directory
Construct aLock
. -
clearLock
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.- Specified by:
clearLock
in classDirectory
- Parameters:
name
- name of the lock to be cleared.- Throws:
IOException
-
setLockFactory
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:
IOException
-
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
-
ensureOpen
- Overrides:
ensureOpen
in classDirectory
- Throws:
AlreadyClosedException
- if this Directory is closed
-