diff --git a/src/main/java/com/lambdaworks/redis/cluster/api/async/NodeSelectionHashAsyncCommands.java b/src/main/java/com/lambdaworks/redis/cluster/api/async/NodeSelectionHashAsyncCommands.java index 0b2e2548a9..9b3022d374 100644 --- a/src/main/java/com/lambdaworks/redis/cluster/api/async/NodeSelectionHashAsyncCommands.java +++ b/src/main/java/com/lambdaworks/redis/cluster/api/async/NodeSelectionHashAsyncCommands.java @@ -119,16 +119,6 @@ public interface NodeSelectionHashAsyncCommands { */ AsyncExecutions hlen(K key); - /** - * Get the string length of the field value in a hash. - * - * @param key the key - * @param field the field type: key - * @return Long integer-reply the string length of the {@code field} value, or {@code 0} when {@code field} is not present - * in the hash or {@code key} does not exist at all. - */ - AsyncExecutions hstrlen(K key, K field); - /** * Get the values of all the given hash fields. * @@ -158,50 +148,6 @@ public interface NodeSelectionHashAsyncCommands { */ AsyncExecutions hmset(K key, Map map); - /** - * Set the string value of a hash field. - * - * @param key the key - * @param field the field type: key - * @param value the value - * @return Boolean integer-reply specifically: - * - * {@literal true} if {@code field} is a new field in the hash and {@code value} was set. {@literal false} if - * {@code field} already exists in the hash and the value was updated. - */ - AsyncExecutions hset(K key, K field, V value); - - /** - * Set the value of a hash field, only if the field does not exist. - * - * @param key the key - * @param field the field type: key - * @param value the value - * @return Boolean integer-reply specifically: - * - * {@code 1} if {@code field} is a new field in the hash and {@code value} was set. {@code 0} if {@code field} - * already exists in the hash and no operation was performed. - */ - AsyncExecutions hsetnx(K key, K field, V value); - - /** - * Get all the values in a hash. - * - * @param key the key - * @return List<V> array-reply list of values in the hash, or an empty list when {@code key} does not exist. - */ - AsyncExecutions> hvals(K key); - - /** - * Stream over all the values in a hash. - * - * @param channel streaming channel that receives a call for every value - * @param key the key - * - * @return Long count of the keys. - */ - AsyncExecutions hvals(ValueStreamingChannel channel, K key); - /** * Incrementally iterate hash fields and associated values. * @@ -277,4 +223,58 @@ public interface NodeSelectionHashAsyncCommands { * @return StreamScanCursor scan cursor. */ AsyncExecutions hscan(KeyValueStreamingChannel channel, K key, ScanCursor scanCursor); + + /** + * Set the string value of a hash field. + * + * @param key the key + * @param field the field type: key + * @param value the value + * @return Boolean integer-reply specifically: + * + * {@literal true} if {@code field} is a new field in the hash and {@code value} was set. {@literal false} if + * {@code field} already exists in the hash and the value was updated. + */ + AsyncExecutions hset(K key, K field, V value); + + /** + * Set the value of a hash field, only if the field does not exist. + * + * @param key the key + * @param field the field type: key + * @param value the value + * @return Boolean integer-reply specifically: + * + * {@code 1} if {@code field} is a new field in the hash and {@code value} was set. {@code 0} if {@code field} + * already exists in the hash and no operation was performed. + */ + AsyncExecutions hsetnx(K key, K field, V value); + + /** + * Get the string length of the field value in a hash. + * + * @param key the key + * @param field the field type: key + * @return Long integer-reply the string length of the {@code field} value, or {@code 0} when {@code field} is not present + * in the hash or {@code key} does not exist at all. + */ + AsyncExecutions hstrlen(K key, K field); + + /** + * Get all the values in a hash. + * + * @param key the key + * @return List<V> array-reply list of values in the hash, or an empty list when {@code key} does not exist. + */ + AsyncExecutions> hvals(K key); + + /** + * Stream over all the values in a hash. + * + * @param channel streaming channel that receives a call for every value + * @param key the key + * + * @return Long count of the keys. + */ + AsyncExecutions hvals(ValueStreamingChannel channel, K key); } diff --git a/src/main/java/com/lambdaworks/redis/cluster/api/sync/NodeSelectionKeyCommands.java b/src/main/java/com/lambdaworks/redis/cluster/api/sync/NodeSelectionKeyCommands.java index 009eeb6353..2a4916c469 100644 --- a/src/main/java/com/lambdaworks/redis/cluster/api/sync/NodeSelectionKeyCommands.java +++ b/src/main/java/com/lambdaworks/redis/cluster/api/sync/NodeSelectionKeyCommands.java @@ -22,13 +22,21 @@ public interface NodeSelectionKeyCommands { /** - * Delete a key. - * - * @param keys the key + * Delete one or more keys. + * + * @param keys the keys * @return Long integer-reply The number of keys that were removed. */ Executions del(K... keys); + /** + * Unlink one or more keys (non blocking DEL). + * + * @param keys the keys + * @return Long integer-reply The number of keys that were removed. + */ + Executions unlink(K... keys); + /** * Return a serialized version of the value stored at the specified key. * diff --git a/src/main/java/com/lambdaworks/redis/cluster/api/sync/NodeSelectionServerCommands.java b/src/main/java/com/lambdaworks/redis/cluster/api/sync/NodeSelectionServerCommands.java index 5438601915..1f434f1663 100644 --- a/src/main/java/com/lambdaworks/redis/cluster/api/sync/NodeSelectionServerCommands.java +++ b/src/main/java/com/lambdaworks/redis/cluster/api/sync/NodeSelectionServerCommands.java @@ -146,6 +146,21 @@ public interface NodeSelectionServerCommands { */ Executions dbsize(); + /** + * Crash and recover + * @param delay optional delay in milliseconds + * @return String simple-string-reply + */ + Executions debugCrashAndRecover(Long delay); + + /** + * Get debugging information about the internal hash-table state. + * + * @param db the database number + * @return String simple-string-reply + */ + Executions debugHtstats(int db); + /** * Get debugging information about a key. * @@ -155,12 +170,26 @@ public interface NodeSelectionServerCommands { Executions debugObject(K key); /** - * Get debugging information about the internal hash-table state. + * Save RDB, clear the database and reload RDB. * - * @param db the database number + * @return String simple-string-reply The commands returns OK on success. + */ + Executions debugReload(); + + /** + * Restart the server gracefully. + * @param delay optional delay in milliseconds * @return String simple-string-reply */ - Executions debugHtstats(int db); + Executions debugRestart(Long delay); + + /** + * Get debugging information about the internal SDS length. + * + * @param key the key + * @return String simple-string-reply + */ + Executions debugSdslen(K key); /** * Remove all keys from all databases. @@ -169,6 +198,13 @@ public interface NodeSelectionServerCommands { */ Executions flushall(); + /** + * Remove all keys asynchronously from all databases. + * + * @return String simple-string-reply + */ + Executions flushallAsync(); + /** * Remove all keys from the current database. * @@ -176,6 +212,13 @@ public interface NodeSelectionServerCommands { */ Executions flushdb(); + /** + * Remove all keys asynchronously from the current database. + * + * @return String simple-string-reply + */ + Executions flushdbAsync(); + /** * Get information and statistics about the server. *