Skip to content

Conversation

Kiminni
Copy link
Contributor

@Kiminni Kiminni commented Aug 31, 2025

Summary

Implements support for Redis 7.0+ SINTERCARD command in Spring Data Redis.

Fixes #2906

Changes

Core Implementation

  • Add sInterCard method to RedisSetCommands interface
  • Implement sInterCard in JedisSetCommands using Jedis client
  • Implement sInterCard in LettuceSetCommands using Lettuce client

Cluster Support

  • Add cluster-aware sInterCard in JedisClusterSetCommands
  • Add cluster-aware sInterCard in LettuceClusterSetCommands
  • Same-slot optimization with native cluster commands
  • Cross-slot fallback using intersection calculation

Connection Wrappers

  • Add sInterCard delegation in DefaultedRedisConnection
  • Add sInterCard support in StringRedisConnection
  • Implement serialization handling in DefaultStringRedisConnection

High-Level API

  • Add user-friendly intersectSize methods to SetOperations
  • Implement intersectSize in DefaultSetOperations
  • Support multiple method overloads for different key patterns

Testing

  • Comprehensive integration tests with @EnabledOnCommand("SINTERCARD")

  • Test coverage for all connection types (Jedis, Lettuce, Cluster)

  • Various intersection scenarios (empty, partial, full)

  • You have read the Spring Data contribution guidelines.

  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.

  • You submit test cases (unit or integration tests) that back your changes.

  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 31, 2025
Signed-off-by: Kiminni <imk0980@gmail.com>
Signed-off-by: Kiminni <imk0980@gmail.com>
Signed-off-by: Kiminni <imk0980@gmail.com>
…etCommands Signed-off-by: Kiminni <imk0980@gmail.com>
…nsIntegrationTests Signed-off-by: Kiminni <imk0980@gmail.com>
@Kiminni Kiminni force-pushed the feature/add-sintercard-operations branch from ac54149 to 4fc1965 Compare August 31, 2025 10:47
@mp911de mp911de self-assigned this Sep 1, 2025
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 1, 2025
Copy link
Contributor

@onobc onobc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the excellent contribution @Kiminni.

I believe there are still a few places to add the new API to:

  • RedisSet / DefaultRedisSet / DefaultRedisZSet
  • BoundSetOperations
  • the Reactive counterparts
Signed-off-by: Kiminni <imk0980@gmail.com>
…OperationsIntegrationTests Signed-off-by: Kiminni <imk0980@gmail.com>
Signed-off-by: Kiminni <imk0980@gmail.com>
Signed-off-by: Kiminni <imk0980@gmail.com>
@Kiminni
Copy link
Contributor Author

Kiminni commented Oct 1, 2025

Hello, @onobc.

I’ve applied the requested changes and addressed the review feedback.
Please review again and let me know if there are any remaining issues or further adjustments needed.

Thank you!

@mp911de mp911de assigned onobc and unassigned mp911de Oct 1, 2025
@onobc onobc added this to the 4.0 RC1 (2025.1.0) milestone Oct 2, 2025
onobc pushed a commit that referenced this pull request Oct 2, 2025
This commit adds support for Redis 7.0+ SINTERCARD command in Spring Data Redis. The `sInterCard` API has been added to SetCommands and ClusterSetCommands for both Jedis and Lettuce. The high-level `intersectSize` API has been added to SetOperations implementations as well. Original Pull Request: #3210 Resolves: #2906 Signed-off-by: Kiminni <imk0980@gmail.com>
@onobc
Copy link
Contributor

onobc commented Oct 2, 2025

Thank you for the contribution @Kiminni - well done! I am closing in favor of b09f752

@onobc onobc closed this Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

4 participants