|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.thimbleware.jmemcached.AbstractCache<LocalCacheElement>
com.thimbleware.jmemcached.CacheImpl
public final class CacheImpl
Default implementation of the cache handler, supporting local memory cache elements.
| Nested Class Summary | |
|---|---|
protected static class |
CacheImpl.DelayedMCElement
Delayed key blocks get processed occasionally. |
| Nested classes/interfaces inherited from interface com.thimbleware.jmemcached.Cache |
|---|
Cache.DeleteResponse, Cache.StoreResponse |
| Field Summary |
|---|
| Fields inherited from class com.thimbleware.jmemcached.AbstractCache |
|---|
casCounter, getCmds, getHits, getMisses, setCmds, started |
| Constructor Summary | |
|---|---|
CacheImpl(CacheStorage<Key,LocalCacheElement> storage)
|
|
| Method Summary | |
|---|---|
Cache.StoreResponse |
add(LocalCacheElement e)
Add an element to the cache |
Cache.StoreResponse |
append(LocalCacheElement element)
Append bytes to the end of an element in the cache |
void |
asyncEventPing()
Called periodically by the network event loop to process any pending events. |
Cache.StoreResponse |
cas(java.lang.Long cas_key,
LocalCacheElement e)
Set an element in the cache but only if the element has not been touched since the last 'gets' |
void |
close()
Close the cache, freeing all resources on which it depends. |
Cache.DeleteResponse |
delete(Key key,
int time)
Handle the deletion of an item from the cache. |
boolean |
flush_all()
Flush all cache entries |
boolean |
flush_all(int expire)
Flush all cache entries with a timestamp after a given expiration time |
java.lang.Integer |
get_add(Key key,
int mod)
Increment/decremen t an (integer) element in the cache |
LocalCacheElement[] |
get(Key... keys)
Get element(s) from the cache |
long |
getCurrentBytes()
|
long |
getCurrentItems()
|
long |
getLimitMaxBytes()
|
protected boolean |
isBlocked(CacheElement e)
|
protected boolean |
isExpired(CacheElement e)
|
protected java.util.Set<Key> |
keys()
|
Cache.StoreResponse |
prepend(LocalCacheElement element)
Prepend bytes to the end of an element in the cache |
Cache.StoreResponse |
replace(LocalCacheElement e)
Replace an element in the cache |
Cache.StoreResponse |
set(LocalCacheElement e)
Set an element in the cache |
| Methods inherited from class com.thimbleware.jmemcached.AbstractCache |
|---|
getGetCmds, getGetHits, getGetMisses, getSetCmds, initStats, Now, stat |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.thimbleware.jmemcached.Cache |
|---|
getGetCmds, getGetHits, getGetMisses, getSetCmds, stat |
| Constructor Detail |
|---|
public CacheImpl(CacheStorage<Key,LocalCacheElement> storage)
| Method Detail |
|---|
public Cache.DeleteResponse delete(Key key,
int time)
Cache
delete in interface Cache<LocalCacheElement>key - the key for the itemtime - an amount of time to block this entry in the cache for further writes
public Cache.StoreResponse add(LocalCacheElement e)
Cache
add in interface Cache<LocalCacheElement>e - the element to add
public Cache.StoreResponse replace(LocalCacheElement e)
Cache
replace in interface Cache<LocalCacheElement>e - the element to replace
public Cache.StoreResponse append(LocalCacheElement element)
Cache
append in interface Cache<LocalCacheElement>element - the element to append
public Cache.StoreResponse prepend(LocalCacheElement element)
Cache
prepend in interface Cache<LocalCacheElement>element - the element to append
public Cache.StoreResponse set(LocalCacheElement e)
Cache
set in interface Cache<LocalCacheElement>e - the element to set
public Cache.StoreResponse cas(java.lang.Long cas_key,
LocalCacheElement e)
Cache
cas in interface Cache<LocalCacheElement>cas_key - the cas key returned by the last getse - the element to set
public java.lang.Integer get_add(Key key,
int mod)
Cache
get_add in interface Cache<LocalCacheElement>key - the key to incrementmod - the amount to add to the value
protected boolean isBlocked(CacheElement e)
protected boolean isExpired(CacheElement e)
public LocalCacheElement[] get(Key... keys)
Cache
get in interface Cache<LocalCacheElement>keys - the key for the element to lookup
public boolean flush_all()
Cache
flush_all in interface Cache<LocalCacheElement>public boolean flush_all(int expire)
Cache
flush_all in interface Cache<LocalCacheElement>expire - the flush time in seconds
public void close()
throws java.io.IOException
Cache
close in interface Cache<LocalCacheElement>java.io.IOExceptionprotected java.util.Set<Key> keys()
keys in class AbstractCache<LocalCacheElement>public long getCurrentItems()
getCurrentItems in interface Cache<LocalCacheElement>getCurrentItems in class AbstractCache<LocalCacheElement>public long getLimitMaxBytes()
getLimitMaxBytes in interface Cache<LocalCacheElement>getLimitMaxBytes in class AbstractCache<LocalCacheElement>public long getCurrentBytes()
getCurrentBytes in interface Cache<LocalCacheElement>getCurrentBytes in class AbstractCache<LocalCacheElement>public void asyncEventPing()
Cache
asyncEventPing in interface Cache<LocalCacheElement>asyncEventPing in class AbstractCache<LocalCacheElement>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||