DATAREDIS-694 - Polishing.

Adapt Lettuce implementation to use async commands in transaction mode. Adapt tests to changed behavior of returning status responses. Extend Javadoc.

Original pull request: #284.
This commit is contained in:
Mark Paluch
2017-11-02 11:21:39 +01:00
parent 8a640a29b6
commit 941b448072
3 changed files with 11 additions and 10 deletions

View File

@@ -177,14 +177,17 @@ public class JedisClusterConnection implements DefaultedRedisClusterConnection {
}
/**
* Execute the given command for the {@code key} provided potentially appending args. <br />
* Execute the given command for each key in {@code keys} provided appending all {@code args} on each invocation.
* <br />
* This method, other than {@link #execute(String, byte[]...)}, dispatches the command to the {@code key} serving
* master node.
* master node and appends the {@code key} as first command argument to the {@code command}. {@code keys} are not
* required to share the same slot for single-key commands. Multi-key commands carrying their keys in {@code args}
* still require to share the same slot as the {@code key}.
*
* <pre>
* <code>
* // SET foo bar EX 10 NX
* execute("SET", "foo".getBytes(), asBinaryList("bar", "EX", 10, "NX")
* execute("SET", "foo".getBytes(), asBinaryList("bar", "EX", 10, "NX"))
* </code>
* </pre>
*
@@ -860,7 +863,8 @@ public class JedisClusterConnection implements DefaultedRedisClusterConnection {
PropertyAccessor accessor = new DirectFieldAccessFallbackBeanWrapper(cluster);
this.connectionHandler = accessor.isReadableProperty("connectionHandler")
? (JedisClusterConnectionHandler) accessor.getPropertyValue("connectionHandler") : null;
? (JedisClusterConnectionHandler) accessor.getPropertyValue("connectionHandler")
: null;
} else {
this.connectionHandler = null;
}

View File

@@ -165,7 +165,7 @@ class LettuceKeyCommands implements RedisKeyCommands {
return null;
}
if (isQueueing()) {
transaction(connection.newLettuceTxResult(getConnection().touch(keys)));
transaction(connection.newLettuceResult(getAsyncConnection().touch(keys)));
return null;
}
return getConnection().touch(keys);