Closed
Conversation
Test Results 253 files + 4 253 suites +4 10m 2s ⏱️ + 3m 3s Results for commit 92bd295. ± Comparison against base commit 8e60c1b. This pull request removes 4 and adds 81 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
So we don't need to implement them in RedisClient
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces three new Redis client classes with a unified builder pattern to simplify configuration and improve developer experience. Key changes include:
- Addition of
RedisClient,RedisClusterClient, andRedisSentinelClientwith builder-based APIs - Implementation of a shared
AbstractRedisClientBuilderand removal of constructor explosion - Removal of deprecated command methods and definition of a
DEFAULT_DIALECTconstant
Reviewed Changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/redis/clients/jedis/RedisClient.java | New standalone Redis client using builder pattern |
| src/main/java/redis/clients/jedis/RedisClusterClient.java | New Redis Cluster client using builder pattern |
| src/main/java/redis/clients/jedis/RedisSentinelClient.java | New Redis Sentinel client using builder pattern |
| src/main/java/redis/clients/jedis/AbstractRedisClientBuilder.java | Shared base class for client builders |
| src/main/java/redis/clients/jedis/CommandObjects.java | Updated default search dialect initialization |
| src/main/java/redis/clients/jedis/search/SearchProtocol.java | Added DEFAULT_DIALECT constant |
| src/main/java/redis/clients/jedis/search/RediSearchCommands.java | Removed deprecated search command overloads |
| src/main/java/redis/clients/jedis/commands/StringCommands.java | Removed deprecated getSet methods |
| src/main/java/redis/clients/jedis/commands/StringBinaryCommands.java | Removed deprecated getSet binary overload |
| src/main/java/redis/clients/jedis/commands/StreamBinaryCommands.java | Removed deprecated xread and xreadGroup methods |
| src/main/java/redis/clients/jedis/commands/SortedSetCommands.java | Removed deprecated zdiffStore methods |
| src/main/java/redis/clients/jedis/commands/SortedSetBinaryCommands.java | Removed deprecated binary zdiffStore methods |
| src/main/java/redis/clients/jedis/commands/ClusterCommands.java | Removed deprecated cluster command methods |
| src/test/java/redis/clients/jedis/RedisClientTest.java | Added comprehensive tests for RedisClient |
| src/test/java/redis/clients/jedis/RedisClusterClientTest.java | Added unit tests for RedisClusterClient |
| src/test/java/redis/clients/jedis/RedisSentinelClientTest.java | Added unit and integration tests for RedisSentinelClient |
| src/test/java/redis/clients/jedis/AbstractRedisClientBuilderTest.java | Added tests for shared builder behavior |
Comments suppressed due to low confidence (2)
src/main/java/redis/clients/jedis/search/SearchProtocol.java:9
- [nitpick] Consider adding a JavaDoc comment for
DEFAULT_DIALECTto explain its purpose and default value.
public static final int DEFAULT_DIALECT = 2;
src/main/java/redis/clients/jedis/AbstractRedisClientBuilder.java:147
- Currently only
searchDialect == 0is disallowed; consider extending validation to reject negative or otherwise out-of-range dialect values (e.g.,searchDialect <= 0).
public T searchDialect(int searchDialect) {
- Implement autocloseable interface in BaseRedisClient to use it in existing tests - Add MULTI methods in BaseRedisClient - Clean up builders - Add missing constructors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces three new Redis client classes (
RedisClient,RedisClusterClient,RedisSentinelClient) that provide a clean, developer-friendly API while addressing critical developer experience issues identified in the current Jedis architecture.Problem Statement
The current Jedis library suffers from significant developer experience issues:
Jedis,JedisPooled,JedisCluster,UnifiedJedis) with unclear distinctionsJedisPoolhave 56+ constructors,JedisPooledhas 65+ constructors, creating analysis paralysisCurrent Architecture Problems
The diagram above shows the current problematic architecture with:
Solution
This PR introduces a new client architecture that addresses these issues through:
BaseRedisClientNew Architecture
The new architecture (green boxes) provides:
BaseRedisClientcontaining all command implementationsBaseRedisClient (Abstract)
RedisClient (Standalone Redis)
BaseRedisClientfor command inheritancePooledConnectionProviderfor automatic connection managementRedisClusterClient (Redis Cluster)
BaseRedisClientwith cluster-specific functionalityClusterConnectionProviderfor slot-based routingRedisSentinelClient (Redis Sentinel)
BaseRedisClientfor Sentinel supportSentineledConnectionProviderfor automatic failoverBuilder Pattern Implementation
All new clients use a consistent builder pattern with shared configuration through
AbstractRedisClientBuilderFuture Work