Class HashStorage

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

public class HashStorage extends BaseStorage
Internal subclass of BaseStorage for the Redis hash data type.

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

  • Constructor Details

    • HashStorage

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

      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
    • 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 class BaseStorage
      Parameters:
      redisClient - Synchronous Redis client
      keys - Keys to retrieve from Redis
      batchSize - Number of objects to retrieve in a single Redis pipeline execution
      Returns:
      List of objects pulled from redis
    • 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