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 voidSet 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:BaseStorageSet a key-value pair in Redis using a pipeline.- Specified by:
setin classBaseStorage- Parameters:
pipeline- The Redis pipeline to usekey- The Redis keyobj- The object to store
-
getResponse
Description copied from class:BaseStorageGet a response for retrieving a value from Redis using a pipeline.- Specified by:
getResponsein 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:BaseStorageRetrieve objects from Redis by keys.- Overrides:
getin 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:BaseStorageConvert byte arrays in the map to appropriate types.- Overrides:
convertBytesin classBaseStorage- Parameters:
map- Map with potential byte arrays- Returns:
- Map with converted values
-