Skip to content

Commit

Permalink
PipelineBase should not contain multi key operations (#2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Dec 9, 2019
1 parent e87e6db commit 7f6bfc7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 7 additions & 3 deletions src/main/java/redis/clients/jedis/MultiKeyPipelineBase.java
Expand Up @@ -709,10 +709,14 @@ public Response<String> migrate(final String host, final int port, final int des
return getResponse(BuilderFactory.STRING);
}

@Override
public Response<Object> sendCommand(ProtocolCommand cmd, String... args){
public Response<Object> sendCommand(final ProtocolCommand cmd, final String... args) {
client.sendCommand(cmd, args);
return getResponse(BuilderFactory.OBJECT);
}


public Response<Object> sendCommand(final ProtocolCommand cmd, final byte[]... args) {
client.sendCommand(cmd, args);
return getResponse(BuilderFactory.OBJECT);
}

}
10 changes: 4 additions & 6 deletions src/main/java/redis/clients/jedis/PipelineBase.java
Expand Up @@ -1975,15 +1975,13 @@ public Response<List<byte[]>> xclaim(byte[] key, byte[] group, byte[] consumerna
return getResponse(BuilderFactory.BYTE_ARRAY_LIST);
}

public Response<Object> sendCommand(ProtocolCommand cmd, String... args){
String key = args.length > 0 ? args[0] : cmd.toString();
getClient(key).sendCommand(cmd, args);
public Response<Object> sendCommand(final String sampleKey, final ProtocolCommand cmd, final String... args) {
getClient(sampleKey).sendCommand(cmd, args);
return getResponse(BuilderFactory.OBJECT);
}

public Response<Object> sendCommand(ProtocolCommand cmd, byte[]... args){
byte[] key = args.length > 0 ? args[0] : cmd.getRaw();
getClient(key).sendCommand(cmd, args);
public Response<Object> sendCommand(final byte[] sampleKey, final ProtocolCommand cmd, final byte[]... args) {
getClient(sampleKey).sendCommand(cmd, args);
return getResponse(BuilderFactory.OBJECT);
}
}

0 comments on commit 7f6bfc7

Please sign in to comment.