接口 Level2Cache
- 所有超级接口:
Cache
- 所有已知实现类:
LettuceCache,LettuceGenericCache,LettuceHashCache,MemCache,NullCache,RedisGenericCache,RedisHashCache
二级缓存接口
- 作者:
- Winter Lau(javayou@gmail.com)
-
字段概要
字段 -
方法概要
修饰符和类型方法说明voidclear()Clear the cachevoidRemove items from the cachedefault boolean判断缓存数据是否存在default ObjectGet an item from the cache, nontransactionallyget(Collection<String> keys) 批量获取缓存对象byte[]读取缓存数据字节数组List<byte[]>getBytes(Collection<String> keys) 同时读取多个 Keykeys()Return all keysdefault voidAdd an item to the cache, nontransactionally, with failfast semanticsdefault void设置缓存数据的有效期default void批量插入数据default voidvoid设置缓存数据字节数组default void设置缓存数据字节数组(带有效期)void同时设置多个数据default void批量设置带 TTL 的缓存数据default boolean是否支持缓存 TTL 的设置
-
字段详细资料
-
log
static final org.slf4j.Logger log
-
-
方法详细资料
-
supportTTL
default boolean supportTTL()是否支持缓存 TTL 的设置- 返回:
- true/false if cache support ttl setting
-
getBytes
读取缓存数据字节数组- 参数:
key- cache key- 返回:
- cache data
-
getBytes
同时读取多个 Key- 参数:
keys- multiple cache key- 返回:
- cache values
-
setBytes
设置缓存数据字节数组- 参数:
key- cache keybytes- cache data
-
setBytes
同时设置多个数据- 参数:
bytes- cache data
-
setBytes
设置缓存数据字节数组(带有效期)- 参数:
key- cache keybytes- cache datatimeToLiveInSeconds- cache ttl
-
setBytes
批量设置带 TTL 的缓存数据- 参数:
bytes- cache datatimeToLiveInSeconds- cache ttl
-
exists
判断缓存数据是否存在 -
keys
Collection<String> keys()Return all keys -
evict
Remove items from the cache -
clear
void clear()Clear the cache -
get
从接口复制的说明:CacheGet an item from the cache, nontransactionally -
get
从接口复制的说明:Cache批量获取缓存对象 -
put
从接口复制的说明:CacheAdd an item to the cache, nontransactionally, with failfast semantics -
put
设置缓存数据的有效期- 参数:
key- cache keyvalue- cache valuetimeToLiveInSeconds- cache ttl
-
put
从接口复制的说明:Cache批量插入数据 -
put
-