|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.blur.store.blockcache_v2.Cache
org.apache.blur.store.blockcache_v2.BaseCache
public class BaseCache
Nested Class Summary | |
---|---|
static class |
BaseCache.STORE
|
Constructor Summary | |
---|---|
BaseCache(long totalNumberOfBytes,
Size fileBufferSize,
Size cacheBlockSize,
FileNameFilter readFilter,
FileNameFilter writeFilter,
Quiet quiet,
BaseCache.STORE store)
|
Method Summary | |
---|---|
boolean |
cacheFileForReading(CacheDirectory directory,
String fileName,
org.apache.lucene.store.IOContext context)
Checks whether file should be cached or not during reading. |
boolean |
cacheFileForWriting(CacheDirectory directory,
String fileName,
org.apache.lucene.store.IOContext context)
Checks whether file should be cached or not during writing. |
void |
close()
|
void |
fileClosedForWriting(CacheDirectory directory,
String fileName,
long fileId)
The cache internals rely on the last modified timestamp of a given file to know if the file is the same or not. |
CacheValue |
get(CacheKey key)
Gets the cache value for the given key. |
int |
getCacheBlockSize(CacheDirectory directory,
String fileName)
Get capacity of each cache entry for the given file. |
int |
getFileBufferSize(CacheDirectory directory,
String fileName)
Gets buffer size of the buffer used while interacting with the underlying directory. |
long |
getFileId(CacheDirectory directory,
String fileName)
Gets unique id for the given file. |
CacheValue |
getQuietly(CacheKey key)
Gets the cache value for the given key. |
CacheValue |
newInstance(CacheDirectory directory,
String fileName,
int cacheBlockSize)
Creates a new instance of CacheValue, the cache capacity should be used for the given file. |
void |
put(CacheKey key,
CacheValue value)
Puts the cache entry into the cache. |
void |
releaseDirectory(String directoryName)
This is called when the CacheDirectory is finalized. |
void |
removeFile(CacheDirectory directory,
String fileName)
Removes the file from the cache. |
boolean |
shouldBeQuiet(CacheDirectory directory,
String fileName)
Determines if the reader should be quiet or not. |
Methods inherited from class org.apache.blur.store.blockcache_v2.Cache |
---|
newInstance |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseCache(long totalNumberOfBytes, Size fileBufferSize, Size cacheBlockSize, FileNameFilter readFilter, FileNameFilter writeFilter, Quiet quiet, BaseCache.STORE store)
Method Detail |
---|
public void close() throws IOException
close
in interface Closeable
IOException
public boolean shouldBeQuiet(CacheDirectory directory, String fileName)
Cache
shouldBeQuiet
in class Cache
directory
- the directory.fileName
- the file name.
public CacheValue newInstance(CacheDirectory directory, String fileName, int cacheBlockSize)
Cache
newInstance
in class Cache
directory
- the directory.fileName
- the file name.cacheBlockSize
- the length of the CacheValue
.
public long getFileId(CacheDirectory directory, String fileName) throws IOException
Cache
getFileId
in class Cache
directory
- the directory.fileName
- the file name.
IOException
public void removeFile(CacheDirectory directory, String fileName) throws IOException
Cache
removeFile
in class Cache
directory
- the directory.fileName
- the file name.
IOException
public void fileClosedForWriting(CacheDirectory directory, String fileName, long fileId) throws IOException
Cache
fileClosedForWriting
in class Cache
fileId
- the file id.
IOException
public int getCacheBlockSize(CacheDirectory directory, String fileName)
Cache
getCacheBlockSize
in class Cache
directory
- the directory.fileName
- the file name.
public int getFileBufferSize(CacheDirectory directory, String fileName)
Cache
getFileBufferSize
in class Cache
directory
- the directory.fileName
- the file name.
public boolean cacheFileForReading(CacheDirectory directory, String fileName, org.apache.lucene.store.IOContext context)
Cache
cacheFileForReading
in class Cache
directory
- the directory.fileName
- the file name.context
- the IOContext from Lucene.
public boolean cacheFileForWriting(CacheDirectory directory, String fileName, org.apache.lucene.store.IOContext context)
Cache
cacheFileForWriting
in class Cache
directory
- the directory.fileName
- the file name.context
- the IOContext from Lucene.
public CacheValue get(CacheKey key)
Cache
get
in class Cache
key
- the key.
public CacheValue getQuietly(CacheKey key)
Cache
getQuietly
in class Cache
key
- the key.
public void put(CacheKey key, CacheValue value)
Cache
put
in class Cache
key
- the key.value
- the value.public void releaseDirectory(String directoryName)
Cache
releaseDirectory
in class Cache
directoryName
- the directory name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |