Skip to content

Conversation

@bsbodden
Copy link
Collaborator

Port of Python RedisVL fix for issue #365. Ensures storage classes use AbstractPipeline instead of Pipeline to support both regular Pipeline and MultiClusterPipeline objects.

Changes:

  • BaseStorage: Changed Pipeline to AbstractPipeline in write() and get() methods, removed unsafe casts to Pipeline
  • HashStorage: Updated set() and getResponse() signatures to accept AbstractPipeline, updated get() to use AbstractPipeline
  • JsonStorage: Updated set() and getResponse() signatures to accept AbstractPipeline
  • EmbeddingsCache: Updated mset(), mget(), and mexists() to use AbstractPipeline
  • Add AbstractPipelineTest with 4 tests verifying compatibility

This ensures compatibility with both standalone Redis and Redis Cluster deployments, matching Python's graceful handling of both Pipeline and ClusterPipeline types via isinstance() checks.

In Java/Jedis:

  • Pipeline extends PipelineBase (deprecated)
  • MultiClusterPipeline extends PipelineBase
  • Both extend AbstractPipeline as common base
  • UnifiedJedis.pipelined() returns AbstractPipeline (may be Pipeline or MultiClusterPipeline depending on provider)

Without this fix, code would fail with ClassCastException when using MultiClusterPipeline in cluster deployments.

Port of Python RedisVL fix for issue #365. Ensures storage classes use
AbstractPipeline instead of Pipeline to support both regular Pipeline
and MultiClusterPipeline objects.

Changes:
- BaseStorage: Changed Pipeline to AbstractPipeline in write() and get()
  methods, removed unsafe casts to Pipeline
- HashStorage: Updated set() and getResponse() signatures to accept
  AbstractPipeline, updated get() to use AbstractPipeline
- JsonStorage: Updated set() and getResponse() signatures to accept
  AbstractPipeline
- EmbeddingsCache: Updated mset(), mget(), and mexists() to use
  AbstractPipeline
- Add AbstractPipelineTest with 4 tests verifying compatibility

This ensures compatibility with both standalone Redis and Redis Cluster
deployments, matching Python's graceful handling of both Pipeline and
ClusterPipeline types via isinstance() checks.

In Java/Jedis:
- Pipeline extends PipelineBase (deprecated)
- MultiClusterPipeline extends PipelineBase
- Both extend AbstractPipeline as common base
- UnifiedJedis.pipelined() returns AbstractPipeline (may be Pipeline or
  MultiClusterPipeline depending on provider)

Without this fix, code would fail with ClassCastException when using
MultiClusterPipeline in cluster deployments.
@bsbodden bsbodden force-pushed the bsb/cluster_pipeline_fix branch from bce035b to e940ce5 Compare October 22, 2025 19:31
@bsbodden bsbodden merged commit 87bca26 into main Oct 22, 2025
4 checks passed
@bsbodden bsbodden deleted the bsb/cluster_pipeline_fix branch October 22, 2025 19:35
@bsbodden bsbodden self-assigned this Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants