Skip to content

Conversation

Kiminni
Copy link

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: SINTERCARD in SetOperations
3 participants