public class RedisHashCache extends Object implements Level2Cache
log
Constructor and Description |
---|
RedisHashCache(String namespace,
String region,
RedisClient client)
缓存构造
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the cache
|
void |
evict(String... keys)
Remove items from the cache
|
boolean |
exists(String key)
判断缓存数据是否存在
|
List<byte[]> |
getBytes(Collection<String> keys)
同时读取多个 Key
|
byte[] |
getBytes(String key)
读取缓存数据字节数组
|
Collection<String> |
keys()
Return all keys
|
void |
setBytes(Map<String,byte[]> bytes)
同时设置多个数据
|
void |
setBytes(String key,
byte[] bytes)
设置缓存数据字节数组
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, get, put, put, put, put, setBytes, setBytes, supportTTL
public RedisHashCache(String namespace, String region, RedisClient client)
namespace
- 命名空间,用于在多个实例中避免 key 的重叠region
- 缓存区域的名称client
- 缓存客户端接口public byte[] getBytes(String key)
Level2Cache
getBytes
in interface Level2Cache
key
- cache keypublic List<byte[]> getBytes(Collection<String> keys)
Level2Cache
getBytes
in interface Level2Cache
keys
- multiple cache keypublic void setBytes(String key, byte[] bytes)
Level2Cache
setBytes
in interface Level2Cache
key
- cache keybytes
- cache datapublic void setBytes(Map<String,byte[]> bytes)
Level2Cache
setBytes
in interface Level2Cache
bytes
- cache datapublic boolean exists(String key)
Level2Cache
exists
in interface Cache
exists
in interface Level2Cache
key
- cache keypublic void evict(String... keys)
Level2Cache
evict
in interface Cache
evict
in interface Level2Cache
keys
- Cache keypublic Collection<String> keys()
Level2Cache
keys
in interface Cache
keys
in interface Level2Cache
public void clear()
Level2Cache
clear
in interface Cache
clear
in interface Level2Cache
Copyright © 2018. All rights reserved.