Package org.apache.solr.core
Class EphemeralDirectoryFactory
- java.lang.Object
-
- org.apache.solr.core.DirectoryFactory
-
- org.apache.solr.core.CachingDirectoryFactory
-
- org.apache.solr.core.EphemeralDirectoryFactory
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,NamedListInitializedPlugin
- Direct Known Subclasses:
ByteBuffersDirectoryFactory
,RAMDirectoryFactory
public abstract class EphemeralDirectoryFactory extends CachingDirectoryFactory
Directory provider for implementations that do not persist over reboots.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.core.CachingDirectoryFactory
CachingDirectoryFactory.CacheValue, CachingDirectoryFactory.CloseListener
-
Nested classes/interfaces inherited from class org.apache.solr.core.DirectoryFactory
DirectoryFactory.DirContext
-
-
Field Summary
-
Fields inherited from class org.apache.solr.core.CachingDirectoryFactory
byDirectoryCache, byPathCache, closeListeners, removeEntries
-
Fields inherited from class org.apache.solr.core.DirectoryFactory
coreContainer, dataHomePath, INDEX_W_TIMESTAMP_REGEX, IOCONTEXT_NO_CACHE, LOCK_TYPE_NATIVE, LOCK_TYPE_NONE, LOCK_TYPE_SIMPLE, LOCK_TYPE_SINGLE
-
-
Constructor Summary
Constructors Constructor Description EphemeralDirectoryFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanupOldIndexDirectories(String dataDirPath, String currentIndexDirPath, boolean reload)
boolean
exists(String path)
Returns true if a Directory exists for a given path in the underlying (stable) storage and contains at least one file.boolean
isAbsolute(String path)
boolean
isPersistent()
void
remove(String path)
This remove is special in that it may be called even after the factory has been closed.void
remove(org.apache.lucene.store.Directory dir)
Removes the Directory's persistent storage.-
Methods inherited from class org.apache.solr.core.CachingDirectoryFactory
addCloseListener, close, deleteOldIndexDirectory, doneWithDirectory, get, getLivePaths, getPath, incRef, init, normalize, release, remove, remove, removeDirectory, stripTrailingSlash
-
Methods inherited from class org.apache.solr.core.DirectoryFactory
create, createLockFactory, empty, getBaseDir, getDataHome, initCoreContainer, isSharedStorage, move, newDefaultUpdateLog, renameWithOverwrite, searchersReserveCommitPoints, size, size, sizeOf, sizeOfDirectory
-
-
-
-
Method Detail
-
exists
public boolean exists(String path) throws IOException
Description copied from class:DirectoryFactory
Returns true if a Directory exists for a given path in the underlying (stable) storage and contains at least one file. Note that the existence of aDirectory
Object as returned by a previous call to theDirectoryFactory.get(java.lang.String, org.apache.solr.core.DirectoryFactory.DirContext, java.lang.String)
method (on the specifiedpath
) is not enough to cause this method to return true. Some prior user of that Directory must have written & synced at least one file to that Directory (and at least one file must still exist)- Overrides:
exists
in classCachingDirectoryFactory
- Throws:
IOException
- If there is a low-level I/O error.
-
isPersistent
public boolean isPersistent()
- Specified by:
isPersistent
in classDirectoryFactory
- Returns:
- true if data is kept after close.
-
isAbsolute
public boolean isAbsolute(String path)
- Overrides:
isAbsolute
in classDirectoryFactory
- Parameters:
path
- the path to check- Returns:
- true if absolute, as in not relative
-
remove
public void remove(org.apache.lucene.store.Directory dir) throws IOException
Description copied from class:DirectoryFactory
Removes the Directory's persistent storage. For example: A file system impl may remove the on disk directory.- Overrides:
remove
in classCachingDirectoryFactory
- Throws:
IOException
- If there is a low-level I/O error.
-
remove
public void remove(String path) throws IOException
Description copied from class:DirectoryFactory
This remove is special in that it may be called even after the factory has been closed. Remove only makes sense for persistent directory factories.- Overrides:
remove
in classCachingDirectoryFactory
- Parameters:
path
- to remove- Throws:
IOException
- If there is a low-level I/O error.
-
cleanupOldIndexDirectories
public void cleanupOldIndexDirectories(String dataDirPath, String currentIndexDirPath, boolean reload)
- Overrides:
cleanupOldIndexDirectories
in classDirectoryFactory
-
-