Skip to content

Commit

Permalink
Addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GumpacG committed Jun 13, 2024
1 parent 5089283 commit c2baa02
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions java/client/src/main/java/glide/api/RedisClusterClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import glide.api.commands.GenericClusterCommands;
import glide.api.commands.ScriptingAndFunctionsClusterCommands;
import glide.api.commands.ServerManagementClusterCommands;
import glide.api.commands.TransactionsBaseClusterCommands;
import glide.api.commands.TransactionsClusterCommands;
import glide.api.models.ClusterTransaction;
import glide.api.models.ClusterValue;
import glide.api.models.commands.FlushMode;
Expand All @@ -63,7 +63,7 @@ public class RedisClusterClient extends BaseClient
GenericClusterCommands,
ServerManagementClusterCommands,
ScriptingAndFunctionsClusterCommands,
TransactionsBaseClusterCommands {
TransactionsClusterCommands {

protected RedisClusterClient(ConnectionManager connectionManager, CommandManager commandManager) {
super(connectionManager, commandManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@ public interface TransactionsBaseCommands {
* will only execute commands if the watched keys are not modified before execution of the
* transaction.
*
* @apiNote When in cluster mode, all <code>keys</code> must map to the same hash slot.
* @apiNote When in cluster mode, the command may route to multiple nodes when <code>keys</code>
* map to different hash slots.
* @see <a href="https://redis.io/docs/latest/commands/watch/">redis.io</a> for details.
* @param keys The keys to watch.
* @return The string <code>OK</code>.
* @return <code>OK</code>.
* @example
* <pre>{@code
* assert client.watch(new String[] {"sampleKey"}).get() == "OK";
* assert client.watch(new String[] {"sampleKey"}).get().equals("OK");
* transaction.set("sampleKey", "foobar");
* Object[] result = client.exec(transaction).get();
* assert result != null; // Executes successfully and keys are unwatched.
*
* assert client.watch(new String[] {"sampleKey"}).get() == "OK";
* assert client.watch(new String[] {"sampleKey"}).get().equals("OK");
* transaction.set("sampleKey", "foobar");
* assert client.set("sampleKey", "hello world").get() == "OK";
* assert client.set("sampleKey", "hello world").get().equals("OK");
* Object[] result = client.exec(transaction).get();
* assert result == null; // null is returned when the watched key is modified before transaction execution.
* }</pre>
Expand All @@ -39,11 +40,11 @@ public interface TransactionsBaseCommands {
* automatically flush all previously watched keys.
*
* @see <a href="https://redis.io/docs/latest/commands/unwatch/">redis.io</a> for details.
* @return The string <code>OK</code>.
* @return <code>OK</code>.
* @example
* <pre>{@code
* assert client.watch(new String[] {"sampleKey"}).get() == "OK";
* assert client.unwatch().get() == "OK"; // Flushes "sampleKey" from watched keys.
* assert client.watch(new String[] {"sampleKey"}).get().equals("OK");
* assert client.unwatch().get().equals("OK"); // Flushes "sampleKey" from watched keys.
* }</pre>
*/
CompletableFuture<String> unwatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
*
* @see <a href="https://redis.io/commands/?group=transactions">Transactions Commands</a>
*/
public interface TransactionsBaseClusterCommands {
public interface TransactionsClusterCommands {
/**
* Flushes all the previously watched keys for a transaction. Executing a transaction will
* automatically flush all previously watched keys.
*
* @see <a href="https://redis.io/docs/latest/commands/unwatch/">redis.io</a> for details.
* @param route Specifies the routing configuration for the command. The client will route the
* command to the nodes defined by <code>route</code>.
* @return The string <code>OK</code>.
* @return <code>OK</code>.
* @example
* <pre>{@code
* assert client.watch(new String[] {"sampleKey"}).get() == "OK";
* assert client.unwatch(ALL_PRIMARIES).get() == "OK"; // Flushes "sampleKey" from watched keys for all primary nodes.
* assert client.watch(new String[] {"sampleKey"}).get().equals("OK");
* assert client.unwatch(ALL_PRIMARIES).get().equals("OK"); // Flushes "sampleKey" from watched keys for all primary nodes.
* }</pre>
*/
CompletableFuture<String> unwatch(Route route);
Expand Down

0 comments on commit c2baa02

Please sign in to comment.