|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.util.CacheTQ
public class CacheTQ
An alternative cache implementation. This implementation uses two caches: a LRU cache and a FIFO cache. Entries are first kept in the FIFO cache, and if referenced again then marked in a hash set. If referenced again, they are moved to the LRU cache. Stream pages are never added to the LRU cache. It is supposed to be more or less scan resistant, and it doesn't cache large rows in the LRU cache.
| Method Summary | |
|---|---|
void |
clear()
Clear the cache. |
CacheObject |
find(int pos)
Get an element from the cache if it is available. |
CacheObject |
get(int pos)
Get an element in the cache if it is available. |
java.util.ArrayList<CacheObject> |
getAllChanged()
Get all objects in the cache that have been changed. |
int |
getMaxMemory()
Get the maximum memory to be used. |
int |
getMemory()
Get the used size in KB. |
void |
put(CacheObject r)
Add an element to the cache. |
boolean |
remove(int pos)
Remove an object from the cache. |
void |
setMaxMemory(int maxMemoryKb)
Set the maximum memory to be used by this cache. |
CacheObject |
update(int pos,
CacheObject record)
Update an element in the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void clear()
Cache
clear in interface Cachepublic CacheObject find(int pos)
Cache
find in interface Cachepos - the unique key of the element
public CacheObject get(int pos)
Cache
get in interface Cachepos - the unique key of the element
public java.util.ArrayList<CacheObject> getAllChanged()
Cache
getAllChanged in interface Cachepublic int getMaxMemory()
Cache
getMaxMemory in interface Cachepublic int getMemory()
Cache
getMemory in interface Cachepublic void put(CacheObject r)
Cache
put in interface Cacher - the objectpublic boolean remove(int pos)
Cache
remove in interface Cachepos - the unique key of the element
public void setMaxMemory(int maxMemoryKb)
Cache
setMaxMemory in interface CachemaxMemoryKb - the maximum size in KB
public CacheObject update(int pos,
CacheObject record)
Cache
update in interface Cachepos - the unique key of the elementrecord - the element
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||