Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PipelineBase should not contain multi key operations #2079

Merged
merged 1 commit into from Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sazzad16 I think we should just deprecate these methods, once you have them in the MultiKeyPipelineBase you don't need these.
I don't think we need those for ShardedJedisPipeline or just move them there with the sample keys.

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);
}
}