org.compass.core.lucene.engine.store.localcache
Class LocalDirectoryCache
java.lang.Object
org.apache.lucene.store.Directory
org.compass.core.lucene.engine.store.localcache.LocalDirectoryCache
- All Implemented Interfaces:
- DirectoryWrapper
public class LocalDirectoryCache
- extends Directory
- implements DirectoryWrapper
A local directory cache wraps an actual Lucene directory with a cache Lucene directory.
This local cache supports several instnaces working against the same directory.
Read operations are performed first by copying the file content to the local cache.
list and lock operations are perfomed directly against the actual directory.
A scheduled taks runs in a 10 seconds interval and clean up the local cache directory
by deleting anything that is in the local cache and not in the remote directory.
- Author:
- kimchy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocalDirectoryCache
public LocalDirectoryCache(String subIndex,
Directory dir,
Directory localCacheDir,
LocalDirectoryCacheManager localDirectoryCacheManager)
LocalDirectoryCache
public LocalDirectoryCache(String subIndex,
Directory dir,
Directory localCacheDir,
int bufferSize,
LocalDirectoryCacheManager localDirectoryCacheManager)
getWrappedDirectory
public Directory getWrappedDirectory()
- Specified by:
getWrappedDirectory in interface DirectoryWrapper
deleteFile
public void deleteFile(String name)
throws IOException
- Specified by:
deleteFile in class Directory
- Throws:
IOException
fileExists
public boolean fileExists(String name)
throws IOException
- Specified by:
fileExists in class Directory
- Throws:
IOException
fileLength
public long fileLength(String name)
throws IOException
- Specified by:
fileLength in class Directory
- Throws:
IOException
fileModified
public long fileModified(String name)
throws IOException
- Specified by:
fileModified in class Directory
- Throws:
IOException
list
public String[] list()
throws IOException
- Specified by:
list in class Directory
- Throws:
IOException
renameFile
public void renameFile(String from,
String to)
throws IOException
- Specified by:
renameFile in class Directory
- Throws:
IOException
touchFile
public void touchFile(String name)
throws IOException
- Specified by:
touchFile in class Directory
- Throws:
IOException
makeLock
public Lock makeLock(String name)
- Overrides:
makeLock in class Directory
close
public void close()
throws IOException
- Specified by:
close in class Directory
- Throws:
IOException
openInput
public IndexInput openInput(String name)
throws IOException
- Specified by:
openInput in class Directory
- Throws:
IOException
createOutput
public IndexOutput createOutput(String name)
throws IOException
- Specified by:
createOutput in class Directory
- Throws:
IOException
clearWrapper
public void clearWrapper()
throws IOException
- Specified by:
clearWrapper in interface DirectoryWrapper
- Throws:
IOException
Copyright (c) 2004-2008 The Compass Project.