@@ -28,7 +28,7 @@ If you need any support, meet lettuce at:
2828
2929
3030Reactive API
31- -----
31+ ------------
3232Lettuce provides since its genesis two API's: Sync and async.
3333Now comes a third one: Reactive.
3434The reactive API uses rx-java and every command on the reactive API returns an Observable.
@@ -89,7 +89,7 @@ New `connect` methods:
8989* `RedisClient.connectSentinel` (provides a `StatefulRedisSentinelConnection`)
9090
9191New segregated command interfaces
92- -----
92+ ---------------------------------
9393Starting with reactive API's, another 13 interfaces will be provided with lettuce.
9494This change increases the count of types within the `com.lambdaworks.redis`
9595package and the package gets messier again. In combination with the stateful connection
@@ -146,21 +146,49 @@ for the migration matrix.
146146* `RedisFuture`s are based on `CompleteableFuture` and throw now any occurred exception when accessing the value using `get()`.
147147Exceptions are passed down the `CompletionStage`s.
148148
149- Advanced Cluster API
150- -----
149+
150+ Cross-slot command execution
151+ ----------------------------
152+ Regular Redis Cluster commands are limited to single-slot keys, basically either single key
153+ commands or multi-key commands that share the same hash slot of their keys.
154+
155+ The cross slot limitation can be mitigated by using the advanced cluster API for some
156+ multi-key commands. Commands that operate on keys with different slots are decomposed into multiple commands.
157+ The single commands are fired in a fork/join fashion. The commands are issued concurrently to avoid
158+ synchronous chaining. Results are synchronized before the command is completed (from a user perspective).
159+
160+ Following commands are supported for cross-slot command execution:
161+
162+ * DEL: Delete the KEYs from the affected cluster. Returns the number of keys that were removed
163+ * MGET: Get the values of all given KEYs. Returns the values in the order of the keys.
164+ * MSET: Set multiple key/value pairs for all given KEYs. Returns always OK.
165+ * Cross-slot command execution is available on the following APIs:
166+
167+ * RedisAdvancedClusterCommands
168+ * RedisAdvancedClusterAsyncCommands
169+ * RedisAdvancedClusterReactiveCommands
170+
171+
172+ Node Selection API/Execution of commands on multiple cluster nodes
173+ ------------------------------------------------------------------
151174The advanced cluster API allows to select nodes and run commands on the node selection:
152175
153- AsyncNodeSelection<String, String> nodes = connection.slaves();
176+ ```java
177+ RedisAdvancedClusterAsyncCommands<String, String> async = clusterClient.connect().async();
178+ AsyncNodeSelection<String, String> slaves = connection.slaves();
154179
155- AsyncExecutions<List<String>> executions = nodes.commands().keys("*");
156- executions.forEach(cs -> cs.thenAccept(keys -> System.out.println(keys)));
180+ AsyncExecutions<List<String>> executions = slaves.commands().keys("*");
181+ executions.forEach(result -> result.thenAccept(keys -> System.out.println(keys)));
182+ ```
183+
184+ Commands are dispatched to the nodes within the selection, the result (CompletionStage) is available through AsyncExecutions.
185+ This API is currently only available for async commands and a technical preview so your feedback is highly appreciated.
157186
158- This API is currently only available for async commands. Commands are dispatched to the nodes within the selection,
159- the result (CompletionStage) is available though AsyncExecutions.
187+ Read more: https://github.com/mp911de/lettuce/wiki/Redis-Cluster-(4.0)
160188
161189
162190Enhancements
163- -----
191+ ------------
164192* Advanced Cluster API (async) #78
165193* Improve HLL command interface #77
166194* Move segregated API interfaces to own packages #76
@@ -183,4 +211,4 @@ lettuce requires a minimum of Java 8 to build and run. It is tested continuously
183211For complete information on lettuce see the websites:
184212
185213* http://github.com/mp911de/lettuce
186- * http://redis.paluch.biz.
214+ * http://redis.paluch.biz.
0 commit comments