|
3 | 3 | import java.time.Duration;
|
4 | 4 | import java.util.List;
|
5 | 5 | import java.util.Map;
|
6 |
| -import java.util.Map.Entry; |
7 | 6 | import java.util.Set;
|
8 | 7 | import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
|
9 | 8 |
|
|
16 | 15 | import redis.clients.jedis.resps.*;
|
17 | 16 | import redis.clients.jedis.stream.*;
|
18 | 17 | import redis.clients.jedis.util.IOUtils;
|
19 |
| -import redis.clients.jedis.commands.JedisXCommands; |
20 |
| -import redis.clients.jedis.commands.JedisXBinaryCommands; |
21 | 18 | import redis.clients.jedis.commands.RedisModuleCommands;
|
22 | 19 | import redis.clients.jedis.json.Path;
|
23 | 20 | import redis.clients.jedis.search.IndexOptions;
|
24 | 21 | import redis.clients.jedis.search.Query;
|
25 | 22 | import redis.clients.jedis.search.Schema;
|
26 | 23 | import redis.clients.jedis.search.SearchResult;
|
| 24 | +import redis.clients.jedis.commands.JedisCommands; |
| 25 | +import redis.clients.jedis.commands.JedisBinaryCommands; |
27 | 26 |
|
28 |
| -public class JedisX implements JedisXCommands, JedisXBinaryCommands, |
29 |
| - SampleKeyedCommands, SampleBinaryKeyedCommands, |
30 |
| - RedisModuleCommands, |
| 27 | +public class UnifiedJedis implements JedisCommands, JedisBinaryCommands, |
| 28 | + SampleKeyedCommands, SampleBinaryKeyedCommands, RedisModuleCommands, |
31 | 29 | AutoCloseable {
|
32 | 30 |
|
33 | 31 | protected final JedisCommandExecutor executor;
|
34 | 32 | private final RedisCommandObjects commandObjects;
|
35 | 33 |
|
36 |
| - public JedisX() { |
| 34 | + public UnifiedJedis() { |
37 | 35 | this(new HostAndPort(Protocol.DEFAULT_HOST, Protocol.DEFAULT_PORT));
|
38 | 36 | }
|
39 | 37 |
|
40 |
| - public JedisX(HostAndPort hostAndPort) { |
| 38 | + public UnifiedJedis(HostAndPort hostAndPort) { |
41 | 39 | this(new Connection(hostAndPort));
|
42 | 40 | }
|
43 | 41 |
|
44 |
| - public JedisX(HostAndPort hostAndPort, JedisClientConfig clientConfig) { |
| 42 | + public UnifiedJedis(HostAndPort hostAndPort, JedisClientConfig clientConfig) { |
45 | 43 | this(new Connection(hostAndPort, clientConfig));
|
46 | 44 | }
|
47 | 45 |
|
48 |
| - public JedisX(JedisSocketFactory socketFactory) { |
| 46 | + public UnifiedJedis(JedisSocketFactory socketFactory) { |
49 | 47 | this(new Connection(socketFactory));
|
50 | 48 | }
|
51 | 49 |
|
52 |
| - public JedisX(Connection connection) { |
| 50 | + public UnifiedJedis(Connection connection) { |
53 | 51 | this.executor = new JedisConnectionExecutor(connection);
|
54 | 52 | this.commandObjects = new RedisCommandObjects();
|
55 | 53 | }
|
56 | 54 |
|
57 |
| - public JedisX(JedisConnectionProvider provider) { |
| 55 | + public UnifiedJedis(JedisConnectionProvider provider) { |
58 | 56 | this.executor = new SimpleJedisExecutor(provider);
|
59 | 57 | this.commandObjects = (provider instanceof JedisClusterConnectionProvider)
|
60 | 58 | ? new RedisClusterCommandObjects() : new RedisCommandObjects();
|
61 | 59 | }
|
62 | 60 |
|
63 |
| - public JedisX(Set<HostAndPort> jedisClusterNodes, JedisClientConfig clientConfig, int maxAttempts) { |
| 61 | + public UnifiedJedis(Set<HostAndPort> jedisClusterNodes, JedisClientConfig clientConfig, int maxAttempts) { |
64 | 62 | this(new JedisClusterConnectionProvider(jedisClusterNodes, clientConfig), maxAttempts,
|
65 | 63 | Duration.ofMillis(maxAttempts * clientConfig.getSocketTimeoutMillis()));
|
66 | 64 | }
|
67 | 65 |
|
68 |
| - public JedisX(Set<HostAndPort> jedisClusterNodes, JedisClientConfig clientConfig, int maxAttempts, Duration maxTotalRetriesDuration) { |
| 66 | + public UnifiedJedis(Set<HostAndPort> jedisClusterNodes, JedisClientConfig clientConfig, int maxAttempts, Duration maxTotalRetriesDuration) { |
69 | 67 | this(new JedisClusterConnectionProvider(jedisClusterNodes, clientConfig), maxAttempts, maxTotalRetriesDuration);
|
70 | 68 | }
|
71 | 69 |
|
72 |
| - public JedisX(Set<HostAndPort> jedisClusterNodes, JedisClientConfig clientConfig, |
| 70 | + public UnifiedJedis(Set<HostAndPort> jedisClusterNodes, JedisClientConfig clientConfig, |
73 | 71 | GenericObjectPoolConfig<Connection> poolConfig, int maxAttempts, Duration maxTotalRetriesDuration) {
|
74 | 72 | this(new JedisClusterConnectionProvider(jedisClusterNodes, clientConfig, poolConfig), maxAttempts, maxTotalRetriesDuration);
|
75 | 73 | }
|
76 | 74 |
|
77 |
| - public JedisX(JedisClusterConnectionProvider provider, int maxAttempts, Duration maxTotalRetriesDuration) { |
| 75 | + public UnifiedJedis(JedisClusterConnectionProvider provider, int maxAttempts, Duration maxTotalRetriesDuration) { |
78 | 76 | if (provider instanceof JedisClusterConnectionProvider) {
|
79 | 77 | this.executor = new RetryableClusterCommandExecutor(provider, maxAttempts, maxTotalRetriesDuration);
|
80 | 78 | this.commandObjects = new RedisClusterCommandObjects();
|
|
0 commit comments