Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for Redis SINTERCARD command #3210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

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).

injae-kim reacted with thumbs up emoji injae-kim reacted with heart emoji injae-kim reacted with rocket emoji
Kiminni added 6 commits August 31, 2025 19:46
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

Kiminni added 6 commits October 1, 2025 07:40
Signed-off-by: Kiminni <imk0980@gmail.com>
...OperationsIntegrationTests
Signed-off-by: Kiminni <imk0980@gmail.com>
Signed-off-by: Kiminni <imk0980@gmail.com>
Copy link
Contributor Author

Kiminni commented Oct 1, 2025
edited
Loading

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!

onobc reacted with thumbs up emoji

@mp911de mp911de assigned onobc and unassigned mp911de Oct 1, 2025
@onobc onobc added this to the 4.0 RC1 (202510) 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>
Copy link
Contributor

onobc commented Oct 2, 2025

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

Kiminni reacted with thumbs up emoji

@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
Reviewers

@onobc onobc onobc requested changes

Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: SINTERCARD in SetOperations

AltStyle によって変換されたページ (->オリジナル) /