Skip to content

Commit

Permalink
Merge branch 'master' into key-arg-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 authored Apr 3, 2024
2 parents b58462c + 2d42338 commit 4bb8198
Show file tree
Hide file tree
Showing 80 changed files with 37,232 additions and 10,536 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit</artifactId>
<version>2.38.0</version> <!-- 3.x requires Java 17 -->
<scope>test</scope>
</dependency>

<!-- circuit breaker / failover -->
<dependency>
Expand Down Expand Up @@ -300,7 +306,7 @@
<!--Sign the components - this is required by maven central for releases -->
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.2</version>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/redis/clients/jedis/BuilderFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -1812,15 +1812,14 @@ public StreamPendingSummary build(Object data) {
}

List<Object> objectList = (List<Object>) data;
long total = BuilderFactory.LONG.build(objectList.get(0));
String minId = SafeEncoder.encode((byte[]) objectList.get(1));
String maxId = SafeEncoder.encode((byte[]) objectList.get(2));
List<List<Object>> consumerObjList = (List<List<Object>>) objectList.get(3);
Map<String, Long> map = new HashMap<>(consumerObjList.size());
for (List<Object> consumerObj : consumerObjList) {
map.put(SafeEncoder.encode((byte[]) consumerObj.get(0)), Long.parseLong(SafeEncoder.encode((byte[]) consumerObj.get(1))));
}
return new StreamPendingSummary(total, new StreamEntryID(minId), new StreamEntryID(maxId), map);
long total = LONG.build(objectList.get(0));
StreamEntryID minId = STREAM_ENTRY_ID.build(objectList.get(1));
StreamEntryID maxId = STREAM_ENTRY_ID.build(objectList.get(2));
Map<String, Long> map = objectList.get(3) == null ? null
: ((List<List<Object>>) objectList.get(3)).stream().collect(
Collectors.toMap(pair -> STRING.build(pair.get(0)),
pair -> Long.parseLong(STRING.build(pair.get(1)))));
return new StreamPendingSummary(total, minId, maxId, map);
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/java/redis/clients/jedis/CommandObjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -3631,6 +3631,7 @@ public final CommandObject<Double> jsonNumIncrBy(String key, Path path, double v
return new CommandObject<>(commandArguments(JsonCommand.NUMINCRBY).key(key).add(path).add(value), BuilderFactory.DOUBLE);
}

@Deprecated
public final CommandObject<Long> jsonArrAppend(String key, String path, JSONObject... objects) {
CommandArguments args = commandArguments(JsonCommand.ARRAPPEND).key(key).add(path);
for (Object object : objects) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/redis/clients/jedis/UnifiedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.json.JSONArray;

import redis.clients.jedis.annots.Experimental;
import redis.clients.jedis.annots.VisibleForTesting;
import redis.clients.jedis.args.*;
import redis.clients.jedis.bloom.*;
import redis.clients.jedis.commands.JedisCommands;
Expand Down Expand Up @@ -213,7 +214,8 @@ private UnifiedJedis(CommandExecutor executor, ConnectionProvider provider) {
}

// Uses a fetched connection to process protocol. Should be avoided if possible.
private UnifiedJedis(CommandExecutor executor, ConnectionProvider provider, CommandObjects commandObjects) {
@VisibleForTesting
public UnifiedJedis(CommandExecutor executor, ConnectionProvider provider, CommandObjects commandObjects) {
this(executor, provider, commandObjects, null);
if (this.provider != null) {
try (Connection conn = this.provider.getConnection()) {
Expand Down
Loading

0 comments on commit 4bb8198

Please sign in to comment.