Repository navigation
Drop deprecated classes and constructors - #4488
Conversation
Test Resultsββ191 filesβ Β±β0ββββ191 suitesβ Β±0βββ11m 37s β±οΈ -1s Results for commit 0d4029d.βΒ± Comparison against base commit 64c3e96. This pull request removes 1 and adds 7 tests. Note that renamed tests count towards both.β»οΈ This comment has been updated with latest results. |
π‘οΈ Jit Security Scan Resultsβ No security findings were detected in this PR
Security scan by Jit
|
5f08848 to
bd5bb35
Compare
| public void test() { | ||
| ManagedConnectionProvider managed = new ManagedConnectionProvider(); | ||
| try (UnifiedJedis jedis = new UnifiedJedis(managed)) { | ||
| try (UnifiedJedis jedis = new UnifiedJedis(managed, RedisProtocol.RESP2)) { |
There was a problem hiding this comment.
wondering if there is a reason for RESP2 explicitly
There was a problem hiding this comment.
This PR removes UnifiedJedis(ConnectionProvider provider) constructor :)
| // We want to be accurate about our mocks, hence we verify no more interactions here. | ||
| // This might mean that some methods need to verify their interactions in a more verbose way, | ||
| // but overall the benefit should be greater than the cost. | ||
| verify(connectionProvider).getConnection(); |
There was a problem hiding this comment.
What is the reason for removing this verification step?
There was a problem hiding this comment.
I've replaced usage of UnifiedJedis(CommandExecutor executor, ConnectionProvider provider, CommandObjects commandObjects) constructor with RedisClient builder above and we don't call the same code path anymore, so connection is no longer acquired from the ConnectionProvider to verify the RESP version.
| public void unifiedJedisConnectsToUds() { | ||
| try (UnifiedJedis jedis = new UnifiedJedis(new UdsJedisSocketFactory())) { | ||
| try (UnifiedJedis jedis = new UnifiedJedis(new Connection(new UdsJedisSocketFactory()))) { | ||
| assertEquals("PONG", jedis.ping()); | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| public void unifiedJedisConnectsToUdsResp3() { | ||
| try (UnifiedJedis jedis = new UnifiedJedis(new UdsJedisSocketFactory(), | ||
| DefaultJedisClientConfig.builder().resp3().build())) { | ||
| try (UnifiedJedis jedis = new UnifiedJedis(new Connection(new UdsJedisSocketFactory(), | ||
| DefaultJedisClientConfig.builder().resp3().build()))) { | ||
| assertEquals("PONG", jedis.ping()); | ||
| } |
There was a problem hiding this comment.
This made me think that we do not provide a documented migration path when using new clients via builders to configure/use a custom socket factory. For example, in this case, for using UDS sockets.
One option as a workaround, users can configure it on a connection provider and then use the factory to create a client with the connection provider.
Since we are also removing JedisPooled, we should document the workaround as a migration path or provide an OOB way to provide a custom socket factory
There is actually a similar discussion recently opened: #4477
There was a problem hiding this comment.
I've added the documentation on how to use UDS with RedisClient
tishun
left a comment
There was a problem hiding this comment.
From the perspective of SDR : I've replaced the JEdis dependency with the one generated from this branch and there are 0 compilation errors and 0 test failures (including integration tests)
| @VisibleForTesting | ||
| @Deprecated | ||
| public UnifiedJedis(CommandExecutor executor, ConnectionProvider provider, CommandObjects commandObjects) { | ||
| protected UnifiedJedis(CommandExecutor executor, ConnectionProvider provider, CommandObjects commandObjects) { |
There was a problem hiding this comment.
FWIW I would even go further and make it with package-private (default) visibility
There was a problem hiding this comment.
For now, I think it's a safer choice to allow apps to use this constructor in their child classes as a workaround if needed.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
β Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0d4029d. Configure here.

Removes JedisPooled and JedisSentineled that have been replaced by RedisClient and RedisSentinelClient and removes deprecated UnifiedJedis constructors
JedisCluster is kept for compatibility with SDR 4.x
Note
Medium Risk
Removes public deprecated classes/constructors and rewires
JedisClusterinitialization, which can break downstream code that still referenced these APIs despite deprecations. Behavioral risk is moderate but mostly limited to construction paths and tests/docs updates.Overview
Removes the deprecated
JedisPooledandJedisSentineledclasses, along with several deprecatedUnifiedJedispublic constructors, further consolidating client creation aroundRedisClient/RedisSentinelClientand builder-based configuration.Updates
JedisClusterconstructors to explicitly construct aClusterCommandExecutor/ClusterCommandObjectsrather than delegating to now-removedUnifiedJediscluster constructors, and adjusts builder defaults to referenceRedisClusterClient.DEFAULT_MAX_ATTEMPTS.Refreshes docs/tests to stop instantiating deprecated clients directly, including a new Advanced Usage section documenting Unix Domain Socket connections via a custom
JedisSocketFactory+PooledConnectionProvider.Reviewed by Cursor Bugbot for commit 0d4029d. Bugbot is set up for automated code reviews on this repo. Configure here.