public final class LruActionTracer
extends java.lang.Object
implements java.lang.Runnable
| Constructor and Description |
|---|
LruActionTracer(DiskCache diskCache,
java.io.File directory,
int appVersion,
long capacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortEdit(CacheEntry cacheEntry) |
void |
abortEdit(java.lang.String key) |
CacheEntry |
beginEdit(java.lang.String key) |
void |
clear() |
void |
close() |
void |
commitEdit(CacheEntry cacheEntry) |
boolean |
delete(java.lang.String key) |
void |
flush()
Force buffered operations to the filesystem.
|
long |
getCapacity() |
java.io.File |
getDirectory() |
CacheEntry |
getEntry(java.lang.String key)
Returns a
CacheEntry named key, or null if it doesn't
exist is not currently readable. |
long |
getSize() |
boolean |
has(java.lang.String key) |
void |
run() |
void |
tryToResume()
try to resume last status when we got off
|
public LruActionTracer(DiskCache diskCache, java.io.File directory, int appVersion, long capacity)
public void tryToResume()
throws java.io.IOException
java.io.IOExceptionpublic void clear()
throws java.io.IOException
java.io.IOExceptionpublic CacheEntry getEntry(java.lang.String key) throws java.io.IOException
CacheEntry named key, or null if it doesn't
exist is not currently readable. If a value is returned, it is moved to
the head of the LRU queue.java.io.IOExceptionpublic CacheEntry beginEdit(java.lang.String key) throws java.io.IOException
java.io.IOExceptionpublic void abortEdit(java.lang.String key)
public void abortEdit(CacheEntry cacheEntry)
public void commitEdit(CacheEntry cacheEntry) throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
java.io.IOExceptionpublic void run()
run in interface java.lang.Runnablepublic boolean delete(java.lang.String key)
throws java.io.IOException
java.io.IOExceptionpublic long getSize()
public long getCapacity()
public java.io.File getDirectory()
public boolean has(java.lang.String key)