public interface IRedisHashCacheWriter
extends org.springframework.data.redis.cache.RedisCacheWriter
IRedisHashCacheWriter provides low level access to Redis commands (HSET, HMSET, HSETNX, HGET, HMGET
HGETALL, HEXPIRE,...) used for caching. IRedisHashCacheWriter may be shared by multiple cache implementations and is responsible for writing / reading
binary data to / from Redis. The implementation honors potential cache lock flags that might be set.RedisCacheWriter| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
hGet(String name,
byte[] key,
byte[] field)
Get the binary value representation from Redis stored for the given key and field.
|
void |
hPut(String name,
byte[] key,
byte[] field,
byte[] value,
Duration ttl)
Write the given (key, field)/value pair to Redis an set the expiration time if defined.
|
byte[] |
hPutIfAbsent(String name,
byte[] key,
byte[] field,
byte[] value,
Duration ttl)
Write the given value to Redis if the key does not already exist.
|
void |
hRemove(String name,
byte[] key,
byte[] field)
Remove the given key and field from Redis.
|
void hPut(String name, byte[] key, byte[] field, byte[] value, @Nullable Duration ttl)
name - The cache name must not be null.key - The key for the cache entry. Must not be null.field - The field for the cache entry. Must not be null.value - The value stored for the key. Must not be null.ttl - Optional expiration time. Can be null.@Nullable byte[] hGet(String name, byte[] key, byte[] field)
name - must not be null.key - must not be null.field - The field for the cache entry. Must not be null.@Nullable byte[] hPutIfAbsent(String name, byte[] key, byte[] field, byte[] value, @Nullable Duration ttl)
name - The cache name must not be null.key - The key for the cache entry. Must not be null.field - The field for the cache entry. Must not be null.value - The value stored for the key. Must not be null.ttl - Optional expiration time. Can be null.void hRemove(String name, byte[] key, byte[] field)
name - The cache name must not be null.key - The key for the cache entry. Must not be null.field - The field for the cache entry. Must not be null.Copyright © 2021. All rights reserved.