org.compass.core.lucene.engine.store.localcache
Class MemoryDirectoryCache
java.lang.Object
org.apache.lucene.store.Directory
org.compass.core.lucene.engine.store.localcache.MemoryDirectoryCache
- All Implemented Interfaces:
- DirectoryWrapper
public class MemoryDirectoryCache
- extends Directory
- implements DirectoryWrapper
Evictable Memory based directory cache wrapping the actual Lucene Directory the index uses. Accepts
connection string parameters: bucketSize which is the size of each bucket entry (defaults
to 1024 bytes), size which controls the maximum amount of memory that will be taken by
the cache before entries will start to be evicted (defaults to 64m), and cacheFileNames
that controls if file names will try to be cached as well (defaults to true).
- Author:
- kimchy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MemoryDirectoryCache
public MemoryDirectoryCache(String connectionString,
Directory dir,
LocalCacheManager localCacheManager)
getBucketSize
public int getBucketSize()
getWrappedDirectory
public Directory getWrappedDirectory()
- Specified by:
getWrappedDirectory in interface DirectoryWrapper
clearWrapper
public void clearWrapper()
throws IOException
- Specified by:
clearWrapper in interface DirectoryWrapper
- Throws:
IOException
list
public String[] list()
throws IOException
- Specified by:
list in class Directory
- Throws:
IOException
fileExists
public boolean fileExists(String name)
throws IOException
- Specified by:
fileExists in class Directory
- Throws:
IOException
fileModified
public long fileModified(String name)
throws IOException
- Specified by:
fileModified in class Directory
- Throws:
IOException
touchFile
public void touchFile(String name)
throws IOException
- Specified by:
touchFile in class Directory
- Throws:
IOException
deleteFile
public void deleteFile(String name)
throws IOException
- Specified by:
deleteFile in class Directory
- Throws:
IOException
renameFile
public void renameFile(String from,
String to)
throws IOException
- Specified by:
renameFile in class Directory
- Throws:
IOException
fileLength
public long fileLength(String name)
throws IOException
- Specified by:
fileLength in class Directory
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close in class Directory
- Throws:
IOException
makeLock
public Lock makeLock(String name)
- Overrides:
makeLock in class Directory
clearLock
public void clearLock(String name)
throws IOException
- Overrides:
clearLock in class Directory
- Throws:
IOException
setLockFactory
public void setLockFactory(LockFactory lockFactory)
- Overrides:
setLockFactory in class Directory
getLockFactory
public LockFactory getLockFactory()
- Overrides:
getLockFactory in class Directory
getLockID
public String getLockID()
- Overrides:
getLockID in class Directory
createOutput
public IndexOutput createOutput(String name)
throws IOException
- Specified by:
createOutput in class Directory
- Throws:
IOException
openInput
public IndexInput openInput(String name)
throws IOException
- Specified by:
openInput in class Directory
- Throws:
IOException
openInput
public IndexInput openInput(String name,
int bufferSize)
throws IOException
- Overrides:
openInput in class Directory
- Throws:
IOException
Copyright (c) 2004-2009 The Compass Project.