|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.solr.core.DirectoryFactory
org.apache.solr.core.CachingDirectoryFactory
public abstract class CachingDirectoryFactory
A DirectoryFactory impl base class for caching Directory instances
per path. Most DirectoryFactory implementations will want to extend this
class and simply implement DirectoryFactory.create(String, DirContext).
This is an expert class and these API's are subject to change.
| Nested Class Summary | |
|---|---|
protected class |
CachingDirectoryFactory.CacheValue
|
static interface |
CachingDirectoryFactory.CloseListener
|
| Nested classes/interfaces inherited from class org.apache.solr.core.DirectoryFactory |
|---|
DirectoryFactory.DirContext |
| Field Summary | |
|---|---|
protected Map<Directory,CachingDirectoryFactory.CacheValue> |
byDirectoryCache
|
protected Map<String,CachingDirectoryFactory.CacheValue> |
byPathCache
|
protected Map<Directory,List<CachingDirectoryFactory.CloseListener>> |
closeListeners
|
protected Set<CachingDirectoryFactory.CacheValue> |
removeEntries
|
| Fields inherited from class org.apache.solr.core.DirectoryFactory |
|---|
IOCONTEXT_NO_CACHE |
| Constructor Summary | |
|---|---|
CachingDirectoryFactory()
|
|
| Method Summary | |
|---|---|
void |
addCloseListener(Directory dir,
CachingDirectoryFactory.CloseListener closeListener)
Adds a close listener for a Directory. |
void |
close()
Close the this and all of the Directories it contains. |
protected abstract Directory |
create(String path,
DirectoryFactory.DirContext dirContext)
Creates a new Directory for a given path. |
void |
doneWithDirectory(Directory directory)
Indicates a Directory will no longer be used, and when it's ref count hits 0, it can be closed. |
boolean |
exists(String path)
Returns true if a Directory exists for a given path. |
Directory |
get(String path,
DirectoryFactory.DirContext dirContext,
String rawLockType)
Returns the Directory for a given path, using the specified rawLockType. |
Set<String> |
getLivePaths()
Test only method for inspecting the cache |
void |
incRef(Directory directory)
Increment the number of references to the given Directory. |
void |
init(NamedList args)
|
String |
normalize(String path)
Normalize a given path. |
void |
release(Directory directory)
Releases the Directory so that it may be closed when it is no longer referenced. |
void |
remove(Directory dir)
Removes the Directory's persistent storage. |
void |
remove(Directory dir,
boolean deleteAfterCoreClose)
Removes the Directory's persistent storage. |
void |
remove(String path)
This remove is special in that it may be called even after the factory has been closed. |
void |
remove(String path,
boolean deleteAfterCoreClose)
This remove is special in that it may be called even after the factory has been closed. |
protected void |
removeDirectory(CachingDirectoryFactory.CacheValue cacheValue)
|
protected String |
stripTrailingSlash(String path)
|
| Methods inherited from class org.apache.solr.core.DirectoryFactory |
|---|
empty, getDataHome, isAbsolute, isPersistent, move, searchersReserveCommitPoints, sizeOf, sizeOfDirectory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<String,CachingDirectoryFactory.CacheValue> byPathCache
protected Map<Directory,CachingDirectoryFactory.CacheValue> byDirectoryCache
protected Map<Directory,List<CachingDirectoryFactory.CloseListener>> closeListeners
protected Set<CachingDirectoryFactory.CacheValue> removeEntries
| Constructor Detail |
|---|
public CachingDirectoryFactory()
| Method Detail |
|---|
public void addCloseListener(Directory dir,
CachingDirectoryFactory.CloseListener closeListener)
DirectoryFactory
addCloseListener in class DirectoryFactory
public void doneWithDirectory(Directory directory)
throws IOException
DirectoryFactory
doneWithDirectory in class DirectoryFactoryIOException - If there is a low-level I/O error.
public void close()
throws IOException
DirectoryFactory
close in interface Closeableclose in class DirectoryFactoryIOException - If there is a low-level I/O error.
protected abstract Directory create(String path,
DirectoryFactory.DirContext dirContext)
throws IOException
DirectoryFactory
create in class DirectoryFactoryIOException - If there is a low-level I/O error.
public boolean exists(String path)
throws IOException
DirectoryFactory
exists in class DirectoryFactoryIOException - If there is a low-level I/O error.
public final Directory get(String path,
DirectoryFactory.DirContext dirContext,
String rawLockType)
throws IOException
DirectoryFactory
get in class DirectoryFactoryIOException - If there is a low-level I/O error.public void incRef(Directory directory)
DirectoryFactory
incRef in class DirectoryFactorypublic void init(NamedList args)
public void release(Directory directory)
throws IOException
DirectoryFactory
release in class DirectoryFactoryIOException - If there is a low-level I/O error.
public void remove(String path)
throws IOException
DirectoryFactory
remove in class DirectoryFactorypath - to remove
IOException - If there is a low-level I/O error.
public void remove(Directory dir)
throws IOException
DirectoryFactory
remove in class DirectoryFactoryIOException - If there is a low-level I/O error.
public void remove(String path,
boolean deleteAfterCoreClose)
throws IOException
DirectoryFactory
remove in class DirectoryFactorypath - to removedeleteAfterCoreClose - whether to wait until after the core is closed.
IOException - If there is a low-level I/O error.
public void remove(Directory dir,
boolean deleteAfterCoreClose)
throws IOException
DirectoryFactory
remove in class DirectoryFactoryIOException - If there is a low-level I/O error.
protected void removeDirectory(CachingDirectoryFactory.CacheValue cacheValue)
throws IOException
IOException
public String normalize(String path)
throws IOException
DirectoryFactory
normalize in class DirectoryFactorypath - to normalize
IOException - on io errorprotected String stripTrailingSlash(String path)
public Set<String> getLivePaths()
doneWithDirectory(org.apache.lucene.store.Directory)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||