| 限定符和类型 | 字段和说明 |
|---|---|
protected long |
cacheHits
Maintain the number of cache hits and misses.
|
protected long |
cacheMisses
Maintain the number of cache hits and misses.
|
protected int |
cacheSize
Maintains the current size of the cache in bytes.
|
protected boolean |
isStopPutWhenFull |
protected int |
maxCacheSize
Maximum size in bytes that the cache can grow to.
|
protected long |
maxLifetime
Maximum length of time objects can exist in cache before expiring.
|
protected String |
name
The name of the cache.
|
| 构造器和说明 |
|---|
RedisCache(String configKey,
String name,
int maxSize,
Long maxLifetime) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected int |
calculateSize(Object object)
Returns the size of an object in bytes.
|
void |
clear()
Removes all cached datas from this cache (optional operation).
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set |
entrySet() |
V |
get(Object key) |
long |
getCacheHits()
Returns the number of cache hits.
|
long |
getCacheMisses()
Returns the number of cache misses.
|
int |
getCacheSize()
Returns the size of the cache contents in bytes.
|
redis.clients.jedis.Jedis |
getClient() |
Set<String> |
getKeys() |
int |
getMaxCacheSize()
Returns the maximum size of the cache in bytes.
|
long |
getMaxLifetime()
Returns the maximum number of milleseconds that any object can live
in cache.
|
K |
getName()
Returns the name of the cache.
|
boolean |
isEmpty() |
Set |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
V |
remove(Object key) |
byte[] |
serialize(Object obj) |
void |
setMaxCacheSize(int maxSize)
Sets the maximum size of the cache in bytes.
|
void |
setMaxLifetime(long maxLifetime)
Sets the maximum number of milleseconds that any object can live
in cache.
|
void |
setStopPutWhenFull(boolean flag)
set the flag whether stop putting into cache when it was full or not.
|
int |
size() |
Object |
unserizlize(byte[] byt) |
Collection |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllprotected int maxCacheSize
protected int cacheSize
protected long maxLifetime
protected long cacheHits
Keeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
protected long cacheMisses
Keeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
protected String name
protected boolean isStopPutWhenFull
public void clear()
Cachepublic long getCacheHits()
CacheKeeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
getCacheHits 在接口中 Cache<K,V>public long getCacheMisses()
CacheKeeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
getCacheMisses 在接口中 Cache<K,V>public int getCacheSize()
CachegetCacheSize 在接口中 Cache<K,V>public int getMaxCacheSize()
CachegetMaxCacheSize 在接口中 Cache<K,V>public long getMaxLifetime()
CachegetMaxLifetime 在接口中 Cache<K,V>public void setMaxCacheSize(int maxSize)
CachesetMaxCacheSize 在接口中 Cache<K,V>maxSize - the maximum size of the cache in bytes.public void setMaxLifetime(long maxLifetime)
CachesetMaxLifetime 在接口中 Cache<K,V>maxLifetime - the maximum number of milleseconds before objects are expired.public void setStopPutWhenFull(boolean flag)
CachesetStopPutWhenFull 在接口中 Cache<K,V>public boolean containsKey(Object key)
containsKey 在接口中 Map<K,V>public boolean containsValue(Object value)
containsValue 在接口中 Map<K,V>public Collection values()
public redis.clients.jedis.Jedis getClient()
protected int calculateSize(Object object)
public byte[] serialize(Object obj)
public Object unserizlize(byte[] byt)
Copyright © 2023 onecode. All rights reserved.