Skip to content

Commit 8ffd10d

Browse files
authored
List Jedis 5.0 breaking changes (#3415)
* List Jedis 5.0 breaking changes * Edit JavaDoc in stream response classes * Comment out in GitHub markdown * Address code review "No need to declare vs. version 4. Should be self-evident." * Address code review "For all of these I think you should change to ```getAgeSeconds() in AccessControlLogEntry``` now returns `Double` instead of `String` . Then, we can sort alphabetically too - and make it easier for users." * edit * Address code review "`quit() method has been removed from `Connection` and ServerCommands implementations`" * Address code review
1 parent d94aa4d commit 8ffd10d

19 files changed

+141
-71
lines changed

docs/3to4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Jedis 3 to Jedis 4 Breaking Changes
1+
# Jedis 4 Breaking Changes
22

33
- The `BinaryJedis` and `BinaryJedisCluster` classes have been removed.
44

docs/jedis5-breaking.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Jedis 5 Breaking Changes
2+
3+
- `StreamConsumersInfo` has been renamed to `StreamConsumerInfo`.
4+
5+
- `bzpopmax(double timeout, byte[]... keys)` now returns `List<Object>` (instead of `List<byte[]>`).
6+
- This is a three element list where the last element is a `Double`.
7+
8+
- `bzpopmin(double timeout, byte[]... keys)` now returns `List<Object>` (instead of `List<byte[]>`).
9+
- This is a three element list where the last element is a `Double`.
10+
11+
- `getAgeSeconds()` in `AccessControlLogEntry` now returns `Double` instead of `String`.
12+
13+
- `graphSlowlog(String graphName)` now returns `List<List<Object>>` (instead of `List<List<String>>`).
14+
15+
- `List<Object> getUnflushedObjectMultiBulkReply()` method has been removed from `Connection`.
16+
- `Object getUnflushedObject()` method has been added instead.
17+
18+
- `STREAM_INFO_FULL` in BuilderFactory has been renamed to `STREAM_FULL_INFO`.
19+
- `STREAM_CONSUMERS_INFO_LIST` in BuilderFactory has been renamed to `STREAM_CONSUMER_INFO_LIST`.
20+
- `STREAM_AUTO_CLAIM_ID_RESPONSE` in BuilderFactory has been renamed to `STREAM_AUTO_CLAIM_JUSTID_RESPONSE`.
21+
22+
- Following BuilderFactory implementations have been removed:
23+
- `BYTE_ARRAY` (use `BINARY`)
24+
- `BYTE_ARRAY_LIST` (use `BINARY_LIST`)
25+
26+
<!--- Deprecated in Jedis 4 --->
27+
28+
- `quit()` method has been removed from `Connection` and `ServerCommands` interface and implementations.
29+
30+
- `select(int index)` method has been removed from `Connection`.
31+
32+
- `updatePassword(String password)` method has been removed from `JedisClientConfig` and implementations.
33+
34+
- `setPassword(String password)` method has been removed from `ConnectionFactory`.
35+
36+
- `setPassword(String password)` method has been removed from `JedisFactory`.
37+
38+
- `get()` option has been removed from `SetParams`. Following methods have been added in Jedis/UnifiedJedis for convenience:
39+
- `setGet(String key, String value)` method has been added in `` interface.
40+
- `setGet(byte[] key, byte[] value)` method has been added in `` interface.
41+
42+
- `xpending(String key, String groupName, StreamEntryID start, StreamEntryID end, int count, String consumerName)` method has been removed from everywhere.
43+
- Use `xpending(java.lang.String, java.lang.String, redis.clients.jedis.params.XPendingParams)` instead.
44+
45+
- `xpending(byte[] key, byte[] groupName, byte[] start, byte[] end, int count, byte[] consumerName)` method has been removed from everywhere.
46+
- Use `xpending(byte[], byte[], redis.clients.jedis.params.XPendingParams)` instead.
47+
48+
- `topkCount(String key, String... items)` method has been removed from everywhere.
49+
50+
- Following methods have been removed:
51+
- `strAlgoLCSStrings(String strA, String strB, StrAlgoLCSParams params)`
52+
- `strAlgoLCSStrings(byte[] strA, byte[] strB, StrAlgoLCSParams params)`
53+
- `strAlgoLCSKeys(String keyA, String keyB, StrAlgoLCSParams params)`
54+
- `strAlgoLCSKeys(byte[] keyA, byte[] keyB, StrAlgoLCSParams params)`
55+
56+
- `StrAlgoLCSParams` has been removed.
57+
58+
- Following methods have been removed from all Pipeline classes:
59+
- `ftCursorRead(String indexName, long cursorId, int count)`
60+
- `ftCursorDel(String indexName, long cursorId)`
61+
- `ftDropIndex(String indexName)`
62+
- `ftDropIndexDD(String indexName)`
63+
- `ftAliasAdd(String aliasName, String indexName)`
64+
- `ftAliasUpdate(String aliasName, String indexName)`
65+
- `ftAliasDel(String aliasName)`
66+
67+
- `addObjects(int[] ints)` method has been removed from `CommandArguments`.
68+
69+
- `getArgsString()` and `serializeRedisArgs(List<byte[]> redisArgs)` methods have been removed from `AggregationBuilder`.
70+
71+
- `totalResults` variable in `AggregationResult` has been made private. Use `getTotalResults()` method instead.
72+
73+
- `retentionTime(long retentionTime)` method in `TSAlterParams` has been removed. Use `retention(long)` method instead.
74+
75+
- `JedisSentineled(String masterName, Set<HostAndPort> sentinels, JedisClientConfig masterClientConfig, JedisClientConfig sentinelClientConfig)` and
76+
`JedisSentineled(String masterName, Set<HostAndPort> sentinels, GenericObjectPoolConfig<Connection> poolConfig, JedisClientConfig masterClientConfig, JedisClientConfig sentinelClientConfig)`
77+
constructors have been removed.
78+
79+
- `JedisClusterInfoCache(JedisClientConfig clientConfig)` and `JedisClusterInfoCache(JedisClientConfig clientConfig, GenericObjectPoolConfig<Connection> poolConfig)`
80+
constructors have been removed.

src/main/java/redis/clients/jedis/BuilderFactory.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ public String toString() {
11011101
}
11021102
};
11031103

1104-
public static final Builder<Map.Entry<StreamEntryID, List<StreamEntryID>>> STREAM_AUTO_CLAIM_ID_RESPONSE
1104+
public static final Builder<Map.Entry<StreamEntryID, List<StreamEntryID>>> STREAM_AUTO_CLAIM_JUSTID_RESPONSE
11051105
= new Builder<Map.Entry<StreamEntryID, List<StreamEntryID>>>() {
11061106
@Override
11071107
@SuppressWarnings("unchecked")
@@ -1281,28 +1281,27 @@ public String toString() {
12811281
}
12821282
};
12831283

1284-
public static final Builder<List<StreamConsumersInfo>> STREAM_CONSUMERS_INFO_LIST = new Builder<List<StreamConsumersInfo>>() {
1284+
public static final Builder<List<StreamConsumerInfo>> STREAM_CONSUMER_INFO_LIST = new Builder<List<StreamConsumerInfo>>() {
12851285

12861286
Map<String, Builder> mappingFunctions = createDecoderMap();
12871287

12881288
private Map<String, Builder> createDecoderMap() {
12891289
Map<String, Builder> tempMappingFunctions = new HashMap<>();
1290-
tempMappingFunctions.put(StreamConsumersInfo.NAME, STRING);
1291-
tempMappingFunctions.put(StreamConsumersInfo.IDLE, LONG);
1292-
tempMappingFunctions.put(StreamGroupInfo.PENDING, LONG);
1293-
tempMappingFunctions.put(StreamGroupInfo.LAST_DELIVERED, STRING);
1290+
tempMappingFunctions.put(StreamConsumerInfo.NAME, STRING);
1291+
tempMappingFunctions.put(StreamConsumerInfo.IDLE, LONG);
1292+
tempMappingFunctions.put(StreamConsumerInfo.PENDING, LONG);
12941293
return tempMappingFunctions;
12951294

12961295
}
12971296

12981297
@Override
12991298
@SuppressWarnings("unchecked")
1300-
public List<StreamConsumersInfo> build(Object data) {
1299+
public List<StreamConsumerInfo> build(Object data) {
13011300
if (null == data) {
13021301
return null;
13031302
}
13041303

1305-
List<StreamConsumersInfo> list = new ArrayList<>();
1304+
List<StreamConsumerInfo> list = new ArrayList<>();
13061305
List<Object> streamsEntries = (List<Object>) data;
13071306
Iterator<Object> groupsArray = streamsEntries.iterator();
13081307

@@ -1312,7 +1311,7 @@ public List<StreamConsumersInfo> build(Object data) {
13121311

13131312
Iterator<Object> consumerInfoIterator = groupInfo.iterator();
13141313

1315-
StreamConsumersInfo streamGroupInfo = new StreamConsumersInfo(
1314+
StreamConsumerInfo streamGroupInfo = new StreamConsumerInfo(
13161315
createMapFromDecodingFunctions(consumerInfoIterator, mappingFunctions));
13171316
list.add(streamGroupInfo);
13181317

@@ -1413,7 +1412,7 @@ public String toString() {
14131412
}
14141413
};
14151414

1416-
public static final Builder<StreamFullInfo> STREAM_INFO_FULL = new Builder<StreamFullInfo>() {
1415+
public static final Builder<StreamFullInfo> STREAM_FULL_INFO = new Builder<StreamFullInfo>() {
14171416

14181417
final Map<String, Builder> mappingFunctions = createDecoderMap();
14191418

src/main/java/redis/clients/jedis/CommandObjects.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,7 +2524,7 @@ public final CommandObject<Map.Entry<StreamEntryID, List<StreamEntryID>>> xautoc
25242524
XAutoClaimParams params) {
25252525
return new CommandObject<>(commandArguments(XAUTOCLAIM).key(key).add(group)
25262526
.add(consumerName).add(minIdleTime).add(start).addParams(params)
2527-
.add(JUSTID), BuilderFactory.STREAM_AUTO_CLAIM_ID_RESPONSE);
2527+
.add(JUSTID), BuilderFactory.STREAM_AUTO_CLAIM_JUSTID_RESPONSE);
25282528
}
25292529

25302530
public final CommandObject<List<byte[]>> xclaim(byte[] key, byte[] group,
@@ -2564,11 +2564,11 @@ public final CommandObject<Object> xinfoStream(byte[] key) {
25642564
}
25652565

25662566
public final CommandObject<StreamFullInfo> xinfoStreamFull(String key) {
2567-
return new CommandObject<>(commandArguments(XINFO).add(STREAM).key(key).add(FULL), BuilderFactory.STREAM_INFO_FULL);
2567+
return new CommandObject<>(commandArguments(XINFO).add(STREAM).key(key).add(FULL), BuilderFactory.STREAM_FULL_INFO);
25682568
}
25692569

25702570
public final CommandObject<StreamFullInfo> xinfoStreamFull(String key, int count) {
2571-
return new CommandObject<>(commandArguments(XINFO).add(STREAM).key(key).add(FULL).add(COUNT).add(count), BuilderFactory.STREAM_INFO_FULL);
2571+
return new CommandObject<>(commandArguments(XINFO).add(STREAM).key(key).add(FULL).add(COUNT).add(count), BuilderFactory.STREAM_FULL_INFO);
25722572
}
25732573

25742574
public final CommandObject<Object> xinfoStreamFull(byte[] key, int count) {
@@ -2587,8 +2587,8 @@ public final CommandObject<List<Object>> xinfoGroups(byte[] key) {
25872587
return new CommandObject<>(commandArguments(XINFO).add(GROUPS).key(key), BuilderFactory.RAW_OBJECT_LIST);
25882588
}
25892589

2590-
public final CommandObject<List<StreamConsumersInfo>> xinfoConsumers(String key, String group) {
2591-
return new CommandObject<>(commandArguments(XINFO).add(CONSUMERS).key(key).add(group), BuilderFactory.STREAM_CONSUMERS_INFO_LIST);
2590+
public final CommandObject<List<StreamConsumerInfo>> xinfoConsumers(String key, String group) {
2591+
return new CommandObject<>(commandArguments(XINFO).add(CONSUMERS).key(key).add(group), BuilderFactory.STREAM_CONSUMER_INFO_LIST);
25922592
}
25932593

25942594
public final CommandObject<List<Object>> xinfoConsumers(byte[] key, byte[] group) {

src/main/java/redis/clients/jedis/Jedis.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9442,7 +9442,7 @@ public List<StreamGroupInfo> xinfoGroups(String key) {
94429442
}
94439443

94449444
@Override
9445-
public List<StreamConsumersInfo> xinfoConsumers(String key, String group) {
9445+
public List<StreamConsumerInfo> xinfoConsumers(String key, String group) {
94469446
return connection.executeCommand(commandObjects.xinfoConsumers(key, group));
94479447
}
94489448

src/main/java/redis/clients/jedis/MultiNodePipelineBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ public Response<List<StreamGroupInfo>> xinfoGroups(String key) {
16131613
}
16141614

16151615
@Override
1616-
public Response<List<StreamConsumersInfo>> xinfoConsumers(String key, String group) {
1616+
public Response<List<StreamConsumerInfo>> xinfoConsumers(String key, String group) {
16171617
return appendCommand(commandObjects.xinfoConsumers(key, group));
16181618
}
16191619

src/main/java/redis/clients/jedis/Pipeline.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ public Response<List<StreamGroupInfo>> xinfoGroups(String key) {
15661566
}
15671567

15681568
@Override
1569-
public Response<List<StreamConsumersInfo>> xinfoConsumers(String key, String group) {
1569+
public Response<List<StreamConsumerInfo>> xinfoConsumers(String key, String group) {
15701570
return appendCommand(commandObjects.xinfoConsumers(key, group));
15711571
}
15721572

src/main/java/redis/clients/jedis/TransactionBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,7 @@ public Response<List<StreamGroupInfo>> xinfoGroups(String key) {
16621662
}
16631663

16641664
@Override
1665-
public Response<List<StreamConsumersInfo>> xinfoConsumers(String key, String group) {
1665+
public Response<List<StreamConsumerInfo>> xinfoConsumers(String key, String group) {
16661666
return appendCommand(commandObjects.xinfoConsumers(key, group));
16671667
}
16681668

src/main/java/redis/clients/jedis/UnifiedJedis.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2997,7 +2997,7 @@ public List<StreamGroupInfo> xinfoGroups(String key) {
29972997
}
29982998

29992999
@Override
3000-
public List<StreamConsumersInfo> xinfoConsumers(String key, String group) {
3000+
public List<StreamConsumerInfo> xinfoConsumers(String key, String group) {
30013001
return executeCommand(commandObjects.xinfoConsumers(key, group));
30023002
}
30033003

src/main/java/redis/clients/jedis/commands/StreamCommands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ Map.Entry<StreamEntryID, List<StreamEntryID>> xautoclaimJustId(String key, Strin
225225
* Introspection command used in order to retrieve different information about consumers in the group
226226
* @param key Stream name
227227
* @param group Group name
228-
* @return List of {@link StreamConsumersInfo} containing information about consumers that belong
228+
* @return List of {@link StreamConsumerInfo} containing information about consumers that belong
229229
* to the the group
230230
*/
231-
List<StreamConsumersInfo> xinfoConsumers(String key, String group);
231+
List<StreamConsumerInfo> xinfoConsumers(String key, String group);
232232

233233
/**
234234
* XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...]

0 commit comments

Comments
 (0)