类 LettuceHashCache

java.lang.Object
net.oschina.j2cache.lettuce.LettuceCache
net.oschina.j2cache.lettuce.LettuceHashCache
所有已实现的接口:
Cache, Level2Cache

public class LettuceHashCache extends LettuceCache
Redis 缓存操作封装,基于 Hashs 实现多个 Region 的缓存
作者:
Winter Lau(javayou@gmail.com) 重要提示!!! hash 存储模式无法单独对 key 设置 expire
  • 构造器详细资料

    • LettuceHashCache

      public LettuceHashCache(String namespace, String region, org.apache.commons.pool2.impl.GenericObjectPool<io.lettuce.core.api.StatefulConnection<String,byte[]>> pool)
  • 方法详细资料

    • getBytes

      public byte[] getBytes(String key)
      从接口复制的说明: Level2Cache
      读取缓存数据字节数组
      参数:
      key - cache key
      返回:
      cache data
    • getBytes

      public List<byte[]> getBytes(Collection<String> keys)
      从接口复制的说明: Level2Cache
      同时读取多个 Key
      参数:
      keys - multiple cache key
      返回:
      cache values
    • setBytes

      public void setBytes(String key, byte[] bytes)
      从接口复制的说明: Level2Cache
      设置缓存数据字节数组
      参数:
      key - cache key
      bytes - cache data
    • setBytes

      public void setBytes(Map<String,byte[]> bytes)
      从接口复制的说明: Level2Cache
      同时设置多个数据
      参数:
      bytes - cache data
    • keys

      public Collection<String> keys()
      从接口复制的说明: Level2Cache
      Return all keys
      返回:
      返回键的集合
    • evict

      public void evict(String... keys)
      从接口复制的说明: Level2Cache
      Remove items from the cache
      参数:
      keys - Cache key
    • clear

      public void clear()
      从接口复制的说明: Level2Cache
      Clear the cache