Package com.redis.vl.storage
Class HashStorage
java.lang.Object
com.redis.vl.storage.BaseStorage
com.redis.vl.storage.HashStorage
Internal subclass of BaseStorage for the Redis hash data type.
Implements hash-specific logic for validation and read/write operations in Redis.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.redis.vl.storage.BaseStorage
BaseStorage.KeyValuePair
-
Field Summary
Fields inherited from class com.redis.vl.storage.BaseStorage
defaultBatchSize, indexSchema
-
Constructor Summary
ConstructorsConstructorDescriptionHashStorage
(IndexSchema indexSchema) Creates a new HashStorage instance for managing Redis hash data structures. -
Method Summary
Modifier and TypeMethodDescriptionconvertBytes
(Map<String, Object> map) Convert byte arrays in the map to appropriate types.get
(UnifiedJedis redisClient, Collection<String> keys, Integer batchSize) Retrieve objects from Redis by keys.getResponse
(Pipeline pipeline, String key) Get a response for retrieving a value from Redis using a pipeline.protected void
Set a key-value pair in Redis using a pipeline.Methods inherited from class com.redis.vl.storage.BaseStorage
createKey, createKeyForObject, get, getIndexSchema, getKeys, preprocessAndValidateObjects, preprocessObject, validate, write, write, write, write, write, write
-
Constructor Details
-
HashStorage
Creates a new HashStorage instance for managing Redis hash data structures.- Parameters:
indexSchema
- The index schema defining the structure of data to be stored
-
-
Method Details
-
set
Description copied from class:BaseStorage
Set a key-value pair in Redis using a pipeline.- Specified by:
set
in classBaseStorage
- Parameters:
pipeline
- The Redis pipeline to usekey
- The Redis keyobj
- The object to store
-
getResponse
Description copied from class:BaseStorage
Get a response for retrieving a value from Redis using a pipeline.- Specified by:
getResponse
in classBaseStorage
- Parameters:
pipeline
- The Redis pipeline to usekey
- The Redis key- Returns:
- Response containing the retrieved object
-
get
public List<Map<String,Object>> get(UnifiedJedis redisClient, Collection<String> keys, Integer batchSize) Description copied from class:BaseStorage
Retrieve objects from Redis by keys.- Overrides:
get
in classBaseStorage
- Parameters:
redisClient
- Synchronous Redis clientkeys
- Keys to retrieve from RedisbatchSize
- Number of objects to retrieve in a single Redis pipeline execution- Returns:
- List of objects pulled from redis
-
convertBytes
Description copied from class:BaseStorage
Convert byte arrays in the map to appropriate types.- Overrides:
convertBytes
in classBaseStorage
- Parameters:
map
- Map with potential byte arrays- Returns:
- Map with converted values
-