Skip to content

Commit

Permalink
Encode map in encoded object (#3555)
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Sep 23, 2023
1 parent c5fdd01 commit 2ea58e0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/main/java/redis/clients/jedis/CommandObjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -2685,33 +2685,33 @@ public final CommandObject<List<byte[]>> xreadGroup(byte[] groupName, byte[] con

// Scripting commands
public final CommandObject<Object> eval(String script) {
return new CommandObject<>(commandArguments(EVAL).add(script).add(0), BuilderFactory.ENCODED_OBJECT);
return new CommandObject<>(commandArguments(EVAL).add(script).add(0), BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> eval(String script, String sampleKey) {
return new CommandObject<>(commandArguments(EVAL).add(script).add(0).processKey(sampleKey), BuilderFactory.ENCODED_OBJECT);
return new CommandObject<>(commandArguments(EVAL).add(script).add(0).processKey(sampleKey), BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> eval(String script, int keyCount, String... params) {
return new CommandObject<>(commandArguments(EVAL).add(script).add(keyCount)
.addObjects((Object[]) params).processKeys(Arrays.copyOf(params, keyCount)),
BuilderFactory.ENCODED_OBJECT);
BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> eval(String script, List<String> keys, List<String> args) {
String[] keysArray = keys.toArray(new String[keys.size()]);
String[] argsArray = args.toArray(new String[args.size()]);
return new CommandObject<>(commandArguments(EVAL).add(script).add(keysArray.length)
.keys((Object[]) keysArray).addObjects((Object[]) argsArray),
BuilderFactory.ENCODED_OBJECT);
BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> evalReadonly(String script, List<String> keys, List<String> args) {
String[] keysArray = keys.toArray(new String[keys.size()]);
String[] argsArray = args.toArray(new String[args.size()]);
return new CommandObject<>(commandArguments(EVAL_RO).add(script).add(keysArray.length)
.keys((Object[]) keysArray).addObjects((Object[]) argsArray),
BuilderFactory.ENCODED_OBJECT);
BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> eval(byte[] script) {
Expand Down Expand Up @@ -2745,33 +2745,33 @@ public final CommandObject<Object> evalReadonly(byte[] script, List<byte[]> keys
}

public final CommandObject<Object> evalsha(String sha1) {
return new CommandObject<>(commandArguments(EVALSHA).add(sha1).add(0), BuilderFactory.ENCODED_OBJECT);
return new CommandObject<>(commandArguments(EVALSHA).add(sha1).add(0), BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> evalsha(String sha1, String sampleKey) {
return new CommandObject<>(commandArguments(EVALSHA).add(sha1).add(0).processKey(sampleKey), BuilderFactory.ENCODED_OBJECT);
return new CommandObject<>(commandArguments(EVALSHA).add(sha1).add(0).processKey(sampleKey), BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> evalsha(String sha1, int keyCount, String... params) {
return new CommandObject<>(commandArguments(EVALSHA).add(sha1).add(keyCount)
.addObjects((Object[]) params).processKeys(Arrays.copyOf(params, keyCount)),
BuilderFactory.ENCODED_OBJECT);
BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> evalsha(String sha1, List<String> keys, List<String> args) {
String[] keysArray = keys.toArray(new String[keys.size()]);
String[] argsArray = args.toArray(new String[args.size()]);
return new CommandObject<>(commandArguments(EVALSHA).add(sha1).add(keysArray.length)
.keys((Object[]) keysArray).addObjects((Object[]) argsArray),
BuilderFactory.ENCODED_OBJECT);
BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> evalshaReadonly(String sha1, List<String> keys, List<String> args) {
String[] keysArray = keys.toArray(new String[keys.size()]);
String[] argsArray = args.toArray(new String[args.size()]);
return new CommandObject<>(commandArguments(EVALSHA_RO).add(sha1).add(keysArray.length)
.keys((Object[]) keysArray).addObjects((Object[]) argsArray),
BuilderFactory.ENCODED_OBJECT);
BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> evalsha(byte[] sha1) {
Expand Down Expand Up @@ -2877,15 +2877,15 @@ public final CommandObject<Object> fcall(String name, List<String> keys, List<St
String[] argsArray = args.toArray(new String[args.size()]);
return new CommandObject<>(commandArguments(FCALL).add(name).add(keysArray.length)
.keys((Object[]) keysArray).addObjects((Object[]) argsArray),
BuilderFactory.ENCODED_OBJECT);
BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<Object> fcallReadonly(String name, List<String> keys, List<String> args) {
String[] keysArray = keys.toArray(new String[keys.size()]);
String[] argsArray = args.toArray(new String[args.size()]);
return new CommandObject<>(commandArguments(FCALL_RO).add(name).add(keysArray.length)
.keys((Object[]) keysArray).addObjects((Object[]) argsArray),
BuilderFactory.ENCODED_OBJECT);
BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
}

public final CommandObject<String> functionDelete(String libraryName) {
Expand Down

0 comments on commit 2ea58e0

Please sign in to comment.