Class JsonStorage

java.lang.Object
com.redis.vl.storage.BaseStorage
com.redis.vl.storage.JsonStorage

public class JsonStorage extends BaseStorage
Internal subclass of BaseStorage for the Redis JSON data type.

Implements json-specific logic for validation and read/write operations in Redis.

  • Constructor Details

    • JsonStorage

      public JsonStorage(IndexSchema indexSchema)
      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

      protected void set(Pipeline pipeline, String key, Map<String,Object> obj)
      Description copied from class: BaseStorage
      Set a key-value pair in Redis using a pipeline.
      Specified by:
      set in class BaseStorage
      Parameters:
      pipeline - The Redis pipeline to use
      key - The Redis key
      obj - The object to store
    • getResponse

      protected Response<Map<String,Object>> getResponse(Pipeline pipeline, String key)
      Description copied from class: BaseStorage
      Get a response for retrieving a value from Redis using a pipeline.
      Specified by:
      getResponse in class BaseStorage
      Parameters:
      pipeline - The Redis pipeline to use
      key - The Redis key
      Returns:
      Response containing the retrieved object
    • convertBytes

      protected Map<String,Object> convertBytes(Map<String,Object> map)
      Description copied from class: BaseStorage
      Convert byte arrays in the map to appropriate types.
      Overrides:
      convertBytes in class BaseStorage
      Parameters:
      map - Map with potential byte arrays
      Returns:
      Map with converted values