Package com.redis.vl.storage
Class JsonStorage
java.lang.Object
com.redis.vl.storage.BaseStorage
com.redis.vl.storage.JsonStorage
Internal subclass of BaseStorage for the Redis JSON data type.
Implements json-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
ConstructorsConstructorDescriptionJsonStorage
(IndexSchema indexSchema) Creates a new JsonStorage instance for managing Redis JSON data structures. -
Method Summary
Modifier and TypeMethodDescriptionconvertBytes
(Map<String, Object> map) Convert byte arrays in the map to appropriate types.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, get, getIndexSchema, getKeys, preprocessAndValidateObjects, preprocessObject, validate, write, write, write, write, write, write
-
Constructor Details
-
JsonStorage
Creates a new JsonStorage instance for managing Redis JSON 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
-
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
-