Class GlideClusterClient
- java.lang.Object
-
- glide.api.BaseClient
-
- glide.api.GlideClusterClient
-
- All Implemented Interfaces:
BitmapBaseCommands,ClusterAdminCommands,ClusterManagementClusterCommands,ClusterOperationsCommands,ConnectionControlCommands,ConnectionManagementClusterCommands,GenericBaseCommands,GenericClusterCommands,GeospatialIndicesBaseCommands,HashBaseCommands,HyperLogLogBaseCommands,ListBaseCommands,NodeManagementCommands,PubSubBaseCommands,PubSubClusterCommands,ScriptingAndFunctionsBaseCommands,ScriptingAndFunctionsClusterCommands,ServerManagementClusterCommands,SetBaseCommands,SortedSetBaseCommands,StreamBaseCommands,StringBaseCommands,TransactionsBaseCommands,TransactionsClusterCommands,java.lang.AutoCloseable
public class GlideClusterClient extends BaseClient implements ClusterAdminCommands, ClusterOperationsCommands, ConnectionControlCommands, ConnectionManagementClusterCommands, GenericClusterCommands, NodeManagementCommands, PubSubClusterCommands, ScriptingAndFunctionsClusterCommands, ServerManagementClusterCommands, TransactionsClusterCommands, ClusterManagementClusterCommands
Client used for connection to cluster servers.
UsecreateClient(glide.api.models.configuration.GlideClusterClientConfiguration)to request a client.- See Also:
full documentation refer to Valkey GLIDE Documentation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class glide.api.BaseClient
BaseClient.ClientBuilder, BaseClient.ResponseFlags
-
-
Field Summary
-
Fields inherited from class glide.api.BaseClient
CANCEL_VALKEY_API, commandManager, connectionManager, COUNT_FOR_LIST_VALKEY_API, COUNT_VALKEY_API, EMPTY_GLIDE_STRING_ARRAY, EMPTY_STRING_ARRAY, IDX_COMMAND_STRING, LCS_MATCHES_RESULT_KEY, LEN_VALKEY_API, LIMIT_VALKEY_API, messageHandler, MINMATCHLEN_COMMAND_STRING, OK, REPLACE_VALKEY_API, SCHEDULE_VALKEY_API, SET_LIMIT_VALKEY_API, subscriptionConfiguration, WITH_SCORE_VALKEY_API, WITH_SCORES_VALKEY_API, WITH_VALUES_VALKEY_API, WITHMATCHLEN_COMMAND_STRING
-
Fields inherited from interface glide.api.commands.GenericBaseCommands
DB_VALKEY_API
-
Fields inherited from interface glide.api.commands.HashBaseCommands
FIELDS_VALKEY_API
-
Fields inherited from interface glide.api.commands.PubSubBaseCommands
ALL_CHANNELS, ALL_PATTERNS
-
Fields inherited from interface glide.api.commands.PubSubClusterCommands
ALL_SHARDED_CHANNELS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGlideClusterClient(BaseClient.ClientBuilder builder)Constructor using ClientParams from BaseClient.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.String>asking()Allows the execution of commands in the context of a slot migration.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>bgrewriteaof()Initiates a background rewrite of the append-only file (AOF).
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>bgrewriteaof(@NonNull RequestRoutingConfiguration.Route route)Initiates a background rewrite of the append-only file (AOF).
The command will be routed to the nodes defined byroute.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>bgsave()Asynchronously saves the dataset to disk in the background.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>bgsave(@NonNull RequestRoutingConfiguration.Route route)Asynchronously saves the dataset to disk in the background.
The command will be routed to the nodes defined byroute.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>bgsaveCancel()Aborts all in-progress and scheduled background saves.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>bgsaveCancel(@NonNull RequestRoutingConfiguration.Route route)Aborts all in-progress and scheduled background saves.
The command will be routed to the nodes defined byroute.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>bgsaveSchedule()Schedules a background save of the database.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>bgsaveSchedule(@NonNull RequestRoutingConfiguration.Route route)Schedules a background save of the database.
The command will be routed to the nodes defined byroute.java.util.concurrent.CompletableFuture<java.lang.String>clientGetName()Gets the name of the current connection.
The command will be routed a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>clientGetName(@NonNull RequestRoutingConfiguration.Route route)Gets the name of the current connection.java.util.concurrent.CompletableFuture<java.lang.Long>clientId()Gets the current connection id.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Long>>clientId(@NonNull RequestRoutingConfiguration.Route route)Gets the current connection id.java.util.concurrent.CompletableFuture<java.lang.String>clientPause(long timeout)Suspends all clients for the specified timeout.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>clientPause(long timeout, @NonNull ClientPauseMode mode)Suspends all clients for the specified timeout.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>clientPause(long timeout, @NonNull ClientPauseMode mode, @NonNull RequestRoutingConfiguration.Route route)Suspends all clients for the specified timeout.
The command will be routed to the nodes defined byroute.java.util.concurrent.CompletableFuture<java.lang.String>clientPause(long timeout, @NonNull RequestRoutingConfiguration.Route route)Suspends all clients for the specified timeout.
The command will be routed to the nodes defined byroute.java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>>clientTrackingInfo()Returns information about the current client connection's use of the server assisted client side caching feature.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>>>clientTrackingInfo(@NonNull RequestRoutingConfiguration.Route route)Returns information about the current client connection's use of the server assisted client side caching feature.java.util.concurrent.CompletableFuture<java.lang.String>clientUnpause()Resumes processing commands on all clients.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>clientUnpause(@NonNull RequestRoutingConfiguration.Route route)Resumes processing commands on all clients.
The command will be routed to the nodes defined byroute.java.util.concurrent.CompletableFuture<java.lang.String>clusterAddSlots(long @NonNull [] slots)Assigns hash slots to the current node.
The command will be routed to the node executing the command.java.util.concurrent.CompletableFuture<java.lang.String>clusterAddSlotsRange(long[] @NonNull [] slotRanges)Assigns hash slot ranges to the current node.
The command will be routed to the node executing the command.java.util.concurrent.CompletableFuture<java.lang.String>clusterBumpEpoch()Forces a node to increment its configuration epoch.java.util.concurrent.CompletableFuture<java.lang.Long>clusterCountFailureReports(@NonNull java.lang.String nodeId)Returns the number of failure reports for the specified node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Long>>clusterCountFailureReports(@NonNull java.lang.String nodeId, @NonNull RequestRoutingConfiguration.Route route)Returns the number of failure reports for the specified node.java.util.concurrent.CompletableFuture<java.lang.Long>clusterCountKeysInSlot(long slot)Returns the number of keys in the specified hash slot.
The command will be routed to the node responsible for the specified slot.java.util.concurrent.CompletableFuture<java.lang.String>clusterDelSlots(long @NonNull [] slots)Removes hash slots from the current node.
The command will be routed to the node executing the command.java.util.concurrent.CompletableFuture<java.lang.String>clusterDelSlotsRange(long[] @NonNull [] slotRanges)Removes hash slot ranges from the current node.
The command will be routed to the node executing the command.java.util.concurrent.CompletableFuture<java.lang.String>clusterFailover()Initiates a manual failover of the primary node to one of its replicas.java.util.concurrent.CompletableFuture<java.lang.String>clusterFailover(@NonNull ClusterFailoverOptions options)Initiates a manual failover of the primary node to one of its replicas with specified options.java.util.concurrent.CompletableFuture<java.lang.String>clusterFlushSlots()Clears the node's hash slot ownership information.java.util.concurrent.CompletableFuture<java.lang.String>clusterForget(@NonNull java.lang.String nodeId)Removes a node from the cluster.java.util.concurrent.CompletableFuture<java.lang.String[]>clusterGetKeysInSlot(long slot, long count)Returns an array of keys stored in the specified hash slot.java.util.concurrent.CompletableFuture<GlideString[]>clusterGetKeysInSlotBinary(long slot, long count)Returns an array of binary keys in the specified hash slot.
The command will be routed to the node responsible for the specified slot.java.util.concurrent.CompletableFuture<java.lang.String>clusterInfo()Gets information and statistics about the cluster state.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>clusterInfo(@NonNull RequestRoutingConfiguration.Route route)Gets information and statistics about the cluster state.java.util.concurrent.CompletableFuture<java.lang.Long>clusterKeySlot(@NonNull GlideString key)Returns the hash slot number for the given binary key.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<java.lang.Long>clusterKeySlot(@NonNull java.lang.String key)Returns the hash slot number for the given key.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<java.lang.Object[]>clusterLinks()Returns information about the TCP links to and from each node in the cluster.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[]>>clusterLinks(@NonNull RequestRoutingConfiguration.Route route)Returns information about the TCP links to and from each node in the cluster.java.util.concurrent.CompletableFuture<java.lang.String>clusterMeet(@NonNull java.lang.String host, long port)Adds a new node to the cluster.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>clusterMeet(@NonNull java.lang.String host, long port, @NonNull RequestRoutingConfiguration.Route route)Adds a new node to the cluster.java.util.concurrent.CompletableFuture<java.lang.String>clusterMyId()Returns the unique identifier (ID) of the current node.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>clusterMyId(@NonNull RequestRoutingConfiguration.Route route)Returns the unique identifier (ID) of the node(s).java.util.concurrent.CompletableFuture<java.lang.String>clusterMyShardId()Returns the shard ID of the current node.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>clusterMyShardId(@NonNull RequestRoutingConfiguration.Route route)Returns the shard ID of the node(s).java.util.concurrent.CompletableFuture<java.lang.String>clusterNodes()Gets a list of all nodes in the cluster and their attributes.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>clusterNodes(@NonNull RequestRoutingConfiguration.Route route)Gets a list of all nodes in the cluster and their attributes.java.util.concurrent.CompletableFuture<java.lang.String[]>clusterReplicas(@NonNull java.lang.String nodeId)Returns a list of replicas (slaves) for the specified primary node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String[]>>clusterReplicas(@NonNull java.lang.String nodeId, @NonNull RequestRoutingConfiguration.Route route)Returns a list of replicas (slaves) for the specified primary node.java.util.concurrent.CompletableFuture<java.lang.String>clusterReplicate(@NonNull java.lang.String nodeId)Configures the current node to replicate data from a primary node identified bynodeId.java.util.concurrent.CompletableFuture<java.lang.String>clusterReset()Resets a cluster node, clearing its cluster configuration and state.java.util.concurrent.CompletableFuture<java.lang.String>clusterReset(@NonNull ClusterResetOptions options)Resets a cluster node with specified options, clearing its cluster configuration and state.
The command must be sent to the node to reset.java.util.concurrent.CompletableFuture<java.lang.String>clusterSaveConfig()Saves the cluster configuration to disk.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>clusterSaveConfig(@NonNull RequestRoutingConfiguration.Route route)Saves the cluster configuration to disk.java.util.concurrent.CompletableFuture<java.lang.String>clusterSetConfigEpoch(long configEpoch)Sets the configuration epoch for a node.java.util.concurrent.CompletableFuture<java.lang.String>clusterSetSlot(long slot, @NonNull ClusterSetSlotOptions options)Manages the assignment of hash slots to nodes in the cluster.java.util.concurrent.CompletableFuture<java.lang.Object[]>clusterShards()Returns details about the shards of the cluster.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[]>>clusterShards(@NonNull RequestRoutingConfiguration.Route route)Returns details about the shards of the cluster.java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.String>>configGet(@NonNull java.lang.String[] parameters)Get the values of configuration parameters.
Starting from server version 7, command supports multiple parameters.
The command will be sent to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.String>>>configGet(@NonNull java.lang.String[] parameters, @NonNull RequestRoutingConfiguration.Route route)Get the values of configuration parameters.
Starting from server version 7, command supports multiple parameters.java.util.concurrent.CompletableFuture<java.lang.String>configResetStat()Resets the statistics reported by the server using the INFO and LATENCY HISTOGRAM commands.
The command will be routed automatically to all nodes.java.util.concurrent.CompletableFuture<java.lang.String>configResetStat(@NonNull RequestRoutingConfiguration.Route route)Resets the statistics reported by the server using the INFO and LATENCY HISTOGRAM commands.java.util.concurrent.CompletableFuture<java.lang.String>configRewrite()Rewrites the configuration file with the current configuration.
The command will be routed automatically to all nodes.java.util.concurrent.CompletableFuture<java.lang.String>configRewrite(@NonNull RequestRoutingConfiguration.Route route)Rewrites the configuration file with the current configuration.java.util.concurrent.CompletableFuture<java.lang.String>configSet(@NonNull java.util.Map<java.lang.String,java.lang.String> parameters)Sets configuration parameters to the specified values.
Starting from server version 7, command supports multiple parameters.
The command will be sent to all nodes.java.util.concurrent.CompletableFuture<java.lang.String>configSet(@NonNull java.util.Map<java.lang.String,java.lang.String> parameters, @NonNull RequestRoutingConfiguration.Route route)Sets configuration parameters to the specified values.
Starting from server version 7, command supports multiple parameters.static java.util.concurrent.CompletableFuture<GlideClusterClient>createClient(@NonNull GlideClusterClientConfiguration config)Creates a newGlideClusterClientinstance and establishes connections to a Valkey Cluster.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>customCommand(@NonNull GlideString[] args)Executes a single command, without checking inputs.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>customCommand(@NonNull GlideString[] args, @NonNull RequestRoutingConfiguration.Route route)Executes a single command, without checking inputs.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>customCommand(@NonNull java.lang.String[] args)Executes a single command, without checking inputs.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>customCommand(@NonNull java.lang.String[] args, @NonNull RequestRoutingConfiguration.Route route)Executes a single command, without checking inputs.java.util.concurrent.CompletableFuture<java.lang.Long>dbsize()Returns the number of keys in the database.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.Long>dbsize(@NonNull RequestRoutingConfiguration.Route route)Returns the number of keys in the database.java.util.concurrent.CompletableFuture<GlideString>echo(@NonNull GlideString message)Echoes the providedmessageback.
The command will be routed a random node.java.util.concurrent.CompletableFuture<ClusterValue<GlideString>>echo(@NonNull GlideString message, @NonNull RequestRoutingConfiguration.Route route)Echoes the providedmessageback.java.util.concurrent.CompletableFuture<java.lang.String>echo(@NonNull java.lang.String message)Echoes the providedmessageback.
The command will be routed a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>echo(@NonNull java.lang.String message, @NonNull RequestRoutingConfiguration.Route route)Echoes the providedmessageback.java.util.concurrent.CompletableFuture<java.lang.Object[]>exec(@NonNull ClusterBatch batch, boolean raiseOnError)Executes a batch by processing the queued commands.java.util.concurrent.CompletableFuture<java.lang.Object[]>exec(@NonNull ClusterBatch batch, boolean raiseOnError, @NonNull ClusterBatchOptions options)Executes a batch by processing the queued commands.java.util.concurrent.CompletableFuture<java.lang.Object[]>exec(@NonNull ClusterTransaction transaction)Deprecated.java.util.concurrent.CompletableFuture<java.lang.Object[]>exec(@NonNull ClusterTransaction transaction, @NonNull RequestRoutingConfiguration.SingleNodeRoute route)Deprecated.java.util.concurrent.CompletableFuture<java.lang.Object>fcall(@NonNull GlideString function)Invokes a previously loaded function.
The command will be routed to a primary random node.
To route to a replica please refer toScriptingAndFunctionsClusterCommands.fcallReadOnly(String).java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>fcall(@NonNull GlideString function, @NonNull RequestRoutingConfiguration.Route route)Invokes a previously loaded function.java.util.concurrent.CompletableFuture<java.lang.Object>fcall(@NonNull GlideString function, @NonNull GlideString[] arguments)Invokes a previously loaded function.
The command will be routed to a random primary node.
To route to a replica please refer toScriptingAndFunctionsClusterCommands.fcallReadOnly(String, String[]).java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>fcall(@NonNull GlideString function, @NonNull GlideString[] arguments, @NonNull RequestRoutingConfiguration.Route route)Invokes a previously loaded function.java.util.concurrent.CompletableFuture<java.lang.Object>fcall(@NonNull java.lang.String function)Invokes a previously loaded function.
The command will be routed to a primary random node.
To route to a replica please refer toScriptingAndFunctionsClusterCommands.fcallReadOnly(String).java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>fcall(@NonNull java.lang.String function, @NonNull RequestRoutingConfiguration.Route route)Invokes a previously loaded function.java.util.concurrent.CompletableFuture<java.lang.Object>fcall(@NonNull java.lang.String function, @NonNull java.lang.String[] arguments)Invokes a previously loaded function.
The command will be routed to a random primary node.
To route to a replica please refer toScriptingAndFunctionsClusterCommands.fcallReadOnly(String, String[]).java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>fcall(@NonNull java.lang.String function, @NonNull java.lang.String[] arguments, @NonNull RequestRoutingConfiguration.Route route)Invokes a previously loaded function.java.util.concurrent.CompletableFuture<java.lang.Object>fcallReadOnly(@NonNull GlideString function)Invokes a previously loaded read-only function.
The command is routed to a random node depending on the client'sReadFromstrategy.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>fcallReadOnly(@NonNull GlideString function, @NonNull RequestRoutingConfiguration.Route route)Invokes a previously loaded read-only function.java.util.concurrent.CompletableFuture<java.lang.Object>fcallReadOnly(@NonNull GlideString function, @NonNull GlideString[] arguments)Invokes a previously loaded function.
The command is routed to a random node depending on the client'sReadFromstrategy.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>fcallReadOnly(@NonNull GlideString function, @NonNull GlideString[] arguments, @NonNull RequestRoutingConfiguration.Route route)Invokes a previously loaded read-only function.java.util.concurrent.CompletableFuture<java.lang.Object>fcallReadOnly(@NonNull java.lang.String function)Invokes a previously loaded read-only function.
The command is routed to a random node depending on the client'sReadFromstrategy.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>fcallReadOnly(@NonNull java.lang.String function, @NonNull RequestRoutingConfiguration.Route route)Invokes a previously loaded read-only function.java.util.concurrent.CompletableFuture<java.lang.Object>fcallReadOnly(@NonNull java.lang.String function, @NonNull java.lang.String[] arguments)Invokes a previously loaded function.
The command is routed to a random node depending on the client'sReadFromstrategy.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>>fcallReadOnly(@NonNull java.lang.String function, @NonNull java.lang.String[] arguments, @NonNull RequestRoutingConfiguration.Route route)Invokes a previously loaded read-only function.java.util.concurrent.CompletableFuture<java.lang.String>flushall()Deletes all the keys of all the existing databases.java.util.concurrent.CompletableFuture<java.lang.String>flushall(@NonNull FlushMode mode)Deletes all the keys of all the existing databases.java.util.concurrent.CompletableFuture<java.lang.String>flushall(@NonNull FlushMode mode, @NonNull RequestRoutingConfiguration.Route route)Deletes all the keys of all the existing databases.java.util.concurrent.CompletableFuture<java.lang.String>flushall(@NonNull RequestRoutingConfiguration.Route route)Deletes all the keys of all the existing databases.java.util.concurrent.CompletableFuture<java.lang.String>flushdb()Deletes all the keys of the currently selected database.java.util.concurrent.CompletableFuture<java.lang.String>flushdb(@NonNull FlushMode mode)Deletes all the keys of the currently selected database.java.util.concurrent.CompletableFuture<java.lang.String>flushdb(@NonNull FlushMode mode, @NonNull RequestRoutingConfiguration.Route route)Deletes all the keys of the currently selected database.java.util.concurrent.CompletableFuture<java.lang.String>flushdb(@NonNull RequestRoutingConfiguration.Route route)Deletes all the keys of the currently selected database.java.util.concurrent.CompletableFuture<java.lang.String>functionDelete(@NonNull GlideString libName)Deletes a library and all its functions.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>functionDelete(@NonNull GlideString libName, @NonNull RequestRoutingConfiguration.Route route)Deletes a library and all its functions.java.util.concurrent.CompletableFuture<java.lang.String>functionDelete(@NonNull java.lang.String libName)Deletes a library and all its functions.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>functionDelete(@NonNull java.lang.String libName, @NonNull RequestRoutingConfiguration.Route route)Deletes a library and all its functions.java.util.concurrent.CompletableFuture<byte[]>functionDump()Returns the serialized payload of all loaded libraries.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<byte[]>>functionDump(@NonNull RequestRoutingConfiguration.Route route)Returns the serialized payload of all loaded libraries.java.util.concurrent.CompletableFuture<java.lang.String>functionFlush()Deletes all function libraries.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>functionFlush(@NonNull FlushMode mode)Deletes all function libraries.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>functionFlush(@NonNull FlushMode mode, @NonNull RequestRoutingConfiguration.Route route)Deletes all function libraries.java.util.concurrent.CompletableFuture<java.lang.String>functionFlush(@NonNull RequestRoutingConfiguration.Route route)Deletes all function libraries.java.util.concurrent.CompletableFuture<java.lang.String>functionKill()Kills a function that is currently executing.
FUNCTION KILLterminates read-only functions only.
The command will be routed to all nodes.java.util.concurrent.CompletableFuture<java.lang.String>functionKill(@NonNull RequestRoutingConfiguration.Route route)Kills a function that is currently executing.
FUNCTION KILLterminates read-only functions only.java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>[]>functionList(boolean withCode)Returns information about the functions and libraries.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>[]>>functionList(boolean withCode, @NonNull RequestRoutingConfiguration.Route route)Returns information about the functions and libraries.java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>[]>functionList(@NonNull java.lang.String libNamePattern, boolean withCode)Returns information about the functions and libraries.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>[]>>functionList(@NonNull java.lang.String libNamePattern, boolean withCode, @NonNull RequestRoutingConfiguration.Route route)Returns information about the functions and libraries.java.util.concurrent.CompletableFuture<java.util.Map<GlideString,java.lang.Object>[]>functionListBinary(boolean withCode)Returns information about the functions and libraries.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<GlideString,java.lang.Object>[]>>functionListBinary(boolean withCode, @NonNull RequestRoutingConfiguration.Route route)Returns information about the functions and libraries.java.util.concurrent.CompletableFuture<java.util.Map<GlideString,java.lang.Object>[]>functionListBinary(@NonNull GlideString libNamePattern, boolean withCode)Returns information about the functions and libraries.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<GlideString,java.lang.Object>[]>>functionListBinary(@NonNull GlideString libNamePattern, boolean withCode, @NonNull RequestRoutingConfiguration.Route route)Returns information about the functions and libraries.java.util.concurrent.CompletableFuture<GlideString>functionLoad(@NonNull GlideString libraryCode, boolean replace)Loads a library to Valkey.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<GlideString>functionLoad(@NonNull GlideString libraryCode, boolean replace, @NonNull RequestRoutingConfiguration.Route route)Loads a library to Valkey.java.util.concurrent.CompletableFuture<java.lang.String>functionLoad(@NonNull java.lang.String libraryCode, boolean replace)Loads a library to Valkey.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>functionLoad(@NonNull java.lang.String libraryCode, boolean replace, @NonNull RequestRoutingConfiguration.Route route)Loads a library to Valkey.java.util.concurrent.CompletableFuture<java.lang.String>functionRestore(byte @NonNull [] payload)Restores libraries from the serialized payload returned byScriptingAndFunctionsClusterCommands.functionDump().
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>functionRestore(byte @NonNull [] payload, @NonNull FunctionRestorePolicy policy)Restores libraries from the serialized payload returned byScriptingAndFunctionsClusterCommands.functionDump().
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>functionRestore(byte @NonNull [] payload, @NonNull FunctionRestorePolicy policy, @NonNull RequestRoutingConfiguration.Route route)Restores libraries from the serialized payload returned byScriptingAndFunctionsClusterCommands.functionDump(Route).java.util.concurrent.CompletableFuture<java.lang.String>functionRestore(byte @NonNull [] payload, @NonNull RequestRoutingConfiguration.Route route)Restores libraries from the serialized payload returned byScriptingAndFunctionsClusterCommands.functionDump(Route).java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>>>functionStats()Returns information about the function that's currently running and information about the available execution engines.
The command will be routed to all nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>>>functionStats(@NonNull RequestRoutingConfiguration.Route route)Returns information about the function that's currently running and information about the available execution engines.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<GlideString,java.util.Map<GlideString,java.lang.Object>>>>functionStatsBinary()Returns information about the function that's currently running and information about the available execution engines.
The command will be routed to all nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<GlideString,java.util.Map<GlideString,java.lang.Object>>>>functionStatsBinary(@NonNull RequestRoutingConfiguration.Route route)Returns information about the function that's currently running and information about the available execution engines.java.util.concurrent.CompletableFuture<PubSubState<ClusterSubscriptionConfiguration.PubSubClusterChannelMode>>getSubscriptions()Gets the current subscription state for this cluster client.protected ClusterValue<java.lang.Object>handleCustomCommandBinaryResponse(RequestRoutingConfiguration.Route route, ResponseOuterClass.Response response)protected ClusterValue<java.lang.Object>handleCustomCommandResponse(RequestRoutingConfiguration.Route route, ResponseOuterClass.Response response)protected ClusterValue<java.util.Map<java.lang.String,java.lang.Object>[]>handleFunctionListResponse(ResponseOuterClass.Response response, RequestRoutingConfiguration.Route route)Process aFUNCTION LISTcluster response.protected ClusterValue<java.util.Map<GlideString,java.lang.Object>[]>handleFunctionListResponseBinary(ResponseOuterClass.Response response, RequestRoutingConfiguration.Route route)Process aFUNCTION LISTcluster response.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>info()Gets information and statistics about the server using theInfoOptions.Section.DEFAULToption.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>info(@NonNull InfoOptions.Section[] sections)Gets information and statistics about the server.
Starting from server version 7, command supports multiple section arguments.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>info(@NonNull InfoOptions.Section[] sections, @NonNull RequestRoutingConfiguration.Route route)Gets information and statistics about the server.
Starting from server version 7, command supports multiple section arguments.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>info(@NonNull RequestRoutingConfiguration.Route route)Gets information and statistics about the server.java.util.concurrent.CompletableFuture<java.lang.Object>invokeScript(@NonNull Script script, @NonNull ScriptArgOptionsGlideString options, @NonNull RequestRoutingConfiguration.Route route)Invokes a Lua script with its keys and arguments.
This method simplifies the process of invoking scripts on the server by using an object that represents a Lua script.java.util.concurrent.CompletableFuture<java.lang.Object>invokeScript(@NonNull Script script, @NonNull ScriptArgOptions options, @NonNull RequestRoutingConfiguration.Route route)Invokes a Lua script with its keys and arguments.
This method simplifies the process of invoking scripts on the server by using an object that represents a Lua script.java.util.concurrent.CompletableFuture<java.lang.Object>invokeScript(@NonNull Script script, @NonNull RequestRoutingConfiguration.Route route)Invokes a Lua script.
This method simplifies the process of invoking scripts on the server by using an object that represents a Lua script.java.util.concurrent.CompletableFuture<ClusterValue<GlideString[]>>keys(GlideString pattern)Returns all keys matchingpattern.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<ClusterValue<GlideString[]>>keys(GlideString pattern, @NonNull RequestRoutingConfiguration.Route route)Returns all keys matchingpattern.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String[]>>keys(java.lang.String pattern)Returns all keys matchingpattern.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String[]>>keys(java.lang.String pattern, @NonNull RequestRoutingConfiguration.Route route)Returns all keys matchingpattern.java.util.concurrent.CompletableFuture<java.lang.Long>lastsave()ReturnsUNIX TIMEof the last DB save timestamp or startup timestamp if no save was made since then.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Long>>lastsave(@NonNull RequestRoutingConfiguration.Route route)ReturnsUNIX TIMEof the last DB save timestamp or startup timestamp if no save was made since then.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[][]>>latencyHistory(@NonNull java.lang.String event)Returns the latency spike time series for the specified event.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[][]>>latencyHistory(@NonNull java.lang.String event, @NonNull RequestRoutingConfiguration.Route route)Returns the latency spike time series for the specified event.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[][]>>latencyLatest()Reports the latest latency events logged by the server.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[][]>>latencyLatest(@NonNull RequestRoutingConfiguration.Route route)Reports the latest latency events logged by the server.java.util.concurrent.CompletableFuture<java.lang.Long>latencyReset()Resets the latency spike time series for all events.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.Long>latencyReset(@NonNull RequestRoutingConfiguration.Route route)Resets the latency spike time series for all events.java.util.concurrent.CompletableFuture<java.lang.Long>latencyReset(@NonNull java.lang.String[] events)Resets the latency spike time series for the specified events.
Ifeventsis empty, resets the latency spike time series for all events.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.Long>latencyReset(@NonNull java.lang.String[] events, @NonNull RequestRoutingConfiguration.Route route)Resets the latency spike time series for the specified events.
Ifeventsis empty, resets the latency spike time series for all events.java.util.concurrent.CompletableFuture<java.lang.String>lolwut()Displays a piece of generative computer art and the Valkey version.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<java.lang.String>lolwut(int version)Displays a piece of generative computer art and the Valkey version.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<java.lang.String>lolwut(int @NonNull [] parameters)Displays a piece of generative computer art and the Valkey version.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>lolwut(int @NonNull [] parameters, @NonNull RequestRoutingConfiguration.Route route)Displays a piece of generative computer art and the Valkey version.java.util.concurrent.CompletableFuture<java.lang.String>lolwut(int version, int @NonNull [] parameters)Displays a piece of generative computer art and the Valkey version.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>lolwut(int version, int @NonNull [] parameters, @NonNull RequestRoutingConfiguration.Route route)Displays a piece of generative computer art and the Valkey version.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>lolwut(int version, @NonNull RequestRoutingConfiguration.Route route)Displays a piece of generative computer art and the Valkey version.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>lolwut(@NonNull RequestRoutingConfiguration.Route route)Displays a piece of generative computer art and the Valkey version.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>memoryDoctor()Returns a report about memory problems detected by the server.
The command will be routed to all primary nodes by default.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>memoryDoctor(@NonNull RequestRoutingConfiguration.Route route)Returns a report about memory problems detected by the server.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>memoryMallocStats()Returns the internal statistics of the memory allocator.
The command will be routed to all primary nodes by default.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>>memoryMallocStats(@NonNull RequestRoutingConfiguration.Route route)Returns the internal statistics of the memory allocator.java.util.concurrent.CompletableFuture<java.lang.String>memoryPurge()Asks the server to reclaim memory from the allocator back to the operating system.
The command will be routed to all primary nodes by default.java.util.concurrent.CompletableFuture<java.lang.String>memoryPurge(@NonNull RequestRoutingConfiguration.Route route)Asks the server to reclaim memory from the allocator back to the operating system.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>>>memoryStats()Returns detailed memory consumption statistics of the server.
The command will be routed to all primary nodes by default.java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>>>memoryStats(@NonNull RequestRoutingConfiguration.Route route)Returns detailed memory consumption statistics of the server.java.util.concurrent.CompletableFuture<java.lang.String>ping()Pings the server.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>ping(@NonNull RequestRoutingConfiguration.Route route)Pings the server.java.util.concurrent.CompletableFuture<GlideString>ping(@NonNull GlideString message)Pings the server.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<GlideString>ping(@NonNull GlideString message, @NonNull RequestRoutingConfiguration.Route route)Pings the server.java.util.concurrent.CompletableFuture<java.lang.String>ping(@NonNull java.lang.String message)Pings the server.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>ping(@NonNull java.lang.String message, @NonNull RequestRoutingConfiguration.Route route)Pings the server.java.util.concurrent.CompletableFuture<java.lang.String>publish(@NonNull GlideString message, @NonNull GlideString channel, boolean sharded)Publishes message on pubsub channel.java.util.concurrent.CompletableFuture<java.lang.String>publish(@NonNull java.lang.String message, @NonNull java.lang.String channel, boolean sharded)Publishes message on pubsub channel.java.util.concurrent.CompletableFuture<java.lang.String[]>pubsubShardChannels()Lists the currently active shard channels.java.util.concurrent.CompletableFuture<GlideString[]>pubsubShardChannels(@NonNull GlideString pattern)Lists the currently active shard channels.java.util.concurrent.CompletableFuture<java.lang.String[]>pubsubShardChannels(@NonNull java.lang.String pattern)Lists the currently active shard channels.java.util.concurrent.CompletableFuture<GlideString[]>pubsubShardChannelsBinary()Lists the currently active shard channels.java.util.concurrent.CompletableFuture<java.util.Map<GlideString,java.lang.Long>>pubsubShardNumSub(@NonNull GlideString[] channels)Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified shard channels.java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Long>>pubsubShardNumSub(@NonNull java.lang.String[] channels)Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified shard channels.java.util.concurrent.CompletableFuture<java.lang.String>randomKey()Returns a random key.
The command will be routed to all primary nodes, and will return the first successful result.java.util.concurrent.CompletableFuture<java.lang.String>randomKey(@NonNull RequestRoutingConfiguration.Route route)Returns a random key.java.util.concurrent.CompletableFuture<GlideString>randomKeyBinary()Returns a random key.
The command will be routed to all primary nodes, and will return the first successful result.java.util.concurrent.CompletableFuture<GlideString>randomKeyBinary(@NonNull RequestRoutingConfiguration.Route route)Returns a random key.java.util.concurrent.CompletableFuture<java.lang.String>readonly()Enables read queries for a connection to a cluster replica node.java.util.concurrent.CompletableFuture<java.lang.String>readwrite()Disables read queries for a connection to a cluster replica node.java.util.concurrent.CompletableFuture<java.lang.String>reset()Resets the connection state.java.util.concurrent.CompletableFuture<java.lang.String>save()Synchronously saves the dataset to disk.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.String>save(@NonNull RequestRoutingConfiguration.Route route)Synchronously saves the dataset to disk.
The command will be routed to the nodes defined byroute.java.util.concurrent.CompletableFuture<java.lang.Object[]>scan(ClusterScanCursor cursor)Incrementally iterates over the keys in the Cluster.java.util.concurrent.CompletableFuture<java.lang.Object[]>scan(ClusterScanCursor cursor, ScanOptions options)Incrementally iterates over the keys in the Cluster.java.util.concurrent.CompletableFuture<java.lang.Object[]>scanBinary(ClusterScanCursor cursor)Incrementally iterates over the keys in the Cluster.java.util.concurrent.CompletableFuture<java.lang.Object[]>scanBinary(ClusterScanCursor cursor, ScanOptions options)Incrementally iterates over the keys in the Cluster.java.util.concurrent.CompletableFuture<java.lang.Boolean[]>scriptExists(@NonNull GlideString[] sha1s)Checks existence of scripts in the script cache by their SHA1 digest.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.Boolean[]>scriptExists(@NonNull GlideString[] sha1s, @NonNull RequestRoutingConfiguration.Route route)Checks existence of scripts in the script cache by their SHA1 digest.java.util.concurrent.CompletableFuture<java.lang.Boolean[]>scriptExists(@NonNull java.lang.String[] sha1s)Checks existence of scripts in the script cache by their SHA1 digest.
The command will be routed to all primary nodes.java.util.concurrent.CompletableFuture<java.lang.Boolean[]>scriptExists(@NonNull java.lang.String[] sha1s, @NonNull RequestRoutingConfiguration.Route route)Checks existence of scripts in the script cache by their SHA1 digest.java.util.concurrent.CompletableFuture<java.lang.String>scriptFlush()Flushes the Lua scripts cache.
The command will be routed to all nodes.java.util.concurrent.CompletableFuture<java.lang.String>scriptFlush(@NonNull FlushMode flushMode)Flushes the Lua scripts cache.
The command will be routed to all nodes.java.util.concurrent.CompletableFuture<java.lang.String>scriptFlush(@NonNull FlushMode flushMode, @NonNull RequestRoutingConfiguration.Route route)Flushes the Lua scripts cache.java.util.concurrent.CompletableFuture<java.lang.String>scriptFlush(@NonNull RequestRoutingConfiguration.Route route)Flushes the Lua scripts cache.java.util.concurrent.CompletableFuture<java.lang.String>scriptKill()Kill the currently executing Lua script, assuming no write operation was yet performed by the script.
The command will be routed to all nodes.java.util.concurrent.CompletableFuture<java.lang.String>scriptKill(@NonNull RequestRoutingConfiguration.Route route)Kills the currently executing Lua script, assuming no write operation was yet performed by the script.java.util.concurrent.CompletableFuture<java.lang.String>select(long index)Changes the currently selected database.java.util.concurrent.CompletableFuture<java.lang.Void>ssubscribe(java.util.Set<java.lang.String> channels, int timeoutMs)Subscribes the client to the specified sharded channels with a timeout.java.util.concurrent.CompletableFuture<java.lang.Void>ssubscribeLazy(java.util.Set<java.lang.String> channels)Subscribes the client to the specified sharded channels and doesn't wait for confirmation.java.util.concurrent.CompletableFuture<java.lang.Void>sunsubscribe(int timeoutMs)Unsubscribes the client from all currently subscribed sharded channels with a timeout.java.util.concurrent.CompletableFuture<java.lang.Void>sunsubscribe(java.util.Set<java.lang.String> channels, int timeoutMs)Unsubscribes the client from the specified sharded channels with a timeout.java.util.concurrent.CompletableFuture<java.lang.Void>sunsubscribeLazy()Unsubscribes the client from all currently subscribed sharded channels.java.util.concurrent.CompletableFuture<java.lang.Void>sunsubscribeLazy(java.util.Set<java.lang.String> channels)Unsubscribes the client from the specified sharded channels.java.util.concurrent.CompletableFuture<java.lang.String[]>time()Returns the server time.
The command will be routed to a random node.java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String[]>>time(@NonNull RequestRoutingConfiguration.Route route)Returns the server time.java.util.concurrent.CompletableFuture<java.lang.String>unwatch()Flushes all the previously watched keys for a transaction.java.util.concurrent.CompletableFuture<java.lang.String>unwatch(@NonNull RequestRoutingConfiguration.Route route)Flushes all the previously watched keys for a transaction.java.util.concurrent.CompletableFuture<java.lang.Long>wait(long numreplicas, long timeout)Blocks the current client until all the previous write commands are successfully transferred and acknowledged by at leastnumreplicasof replicas.java.util.concurrent.CompletableFuture<java.lang.Long[]>waitaof(long numlocal, long numreplicas, long timeout, @NonNull RequestRoutingConfiguration.Route route)Blocks the current client until all previous write commands are successfully transferred and acknowledged by at leastnumlocalandnumreplicasof replicas.-
Methods inherited from class glide.api.BaseClient
__enqueuePubSubMessage, aclCat, aclCat, aclDelUser, aclDryRun, aclGenPass, aclGenPass, aclGetUser, aclList, aclLoad, aclLog, aclLog, aclSave, aclSetUser, aclUsers, aclWhoami, append, append, bitcount, bitcount, bitcount, bitcount, bitcount, bitcount, bitcount, bitcount, bitfield, bitfield, bitfieldReadOnly, bitfieldReadOnly, bitop, bitop, bitpos, bitpos, bitpos, bitpos, bitpos, bitpos, bitpos, bitpos, blmove, blmove, blmpop, blmpop, blmpop, blmpop, blpop, blpop, brpop, brpop, buildCommandManager, buildConnectionManager, buildMessageHandler, bzmpop, bzmpop, bzmpop, bzmpop, bzpopmax, bzpopmax, bzpopmin, bzpopmin, close, copy, copy, copy, copy, copy, copy, copy, copy, createClient, decr, decr, decrBy, decrBy, del, del, dump, evalReadOnly, evalReadOnly, evalReadOnly, evalReadOnly, evalshaReadOnly, evalshaReadOnly, evalshaReadOnly, evalshaReadOnly, exists, exists, expire, expire, expire, expire, expireAt, expireAt, expireAt, expireAt, expiretime, expiretime, fcall, fcall, fcallReadOnly, fcallReadOnly, geoadd, geoadd, geoadd, geoadd, geodist, geodist, geodist, geodist, geohash, geohash, geopos, geopos, geosearch, geosearch, geosearch, geosearch, geosearch, geosearch, geosearch, geosearch, geosearchstore, geosearchstore, geosearchstore, geosearchstore, geosearchstore, geosearchstore, geosearchstore, geosearchstore, get, get, getbit, getbit, getCacheEntryCount, getCacheEvictions, getCacheExpirations, getCacheHitRate, getCacheMissRate, getCacheTotalLookups, getClientInfo, getdel, getdel, getex, getex, getex, getex, getPubSubMessage, getrange, getrange, getStatistics, handleArrayOrNullResponse, handleArrayOrNullResponseBinary, handleArrayResponse, handleArrayResponseBinary, handleBinaryObjectOrNullResponse, handleBinaryStringMapOfArraysResponse, handleBinaryStringMapOrNullResponse, handleBinaryStringMapResponse, handleBooleanResponse, handleBytesOrNullResponse, handleDoubleOrNullResponse, handleDoubleResponse, handleFunctionListResponse, handleFunctionListResponseBinary, handleFunctionStatsBinaryResponse, handleFunctionStatsBinaryResponse, handleFunctionStatsResponse, handleFunctionStatsResponse, handleGlideStringOrNullResponse, handleGlideStringResponse, handleLcsIdxResponse, handleLongOrNullResponse, handleLongResponse, handleMapOfArraysResponse, handleMapOrNullResponse, handleMapResponse, handleObjectOrNullResponse, handleSetBinaryResponse, handleSetResponse, handleStringOrNullResponse, handleStringResponse, handleValkeyResponse, handleXReadResponse, handleXReadResponseBinary, hdel, hdel, hexists, hexists, hexpire, hexpire, hexpireat, hexpireat, hexpiretime, hexpiretime, hget, hget, hgetall, hgetall, hgetex, hgetex, hincrBy, hincrBy, hincrByFloat, hincrByFloat, hkeys, hkeys, hlen, hlen, hmget, hmget, hpersist, hpersist, hpexpire, hpexpire, hpexpireat, hpexpireat, hpexpiretime, hpexpiretime, hpttl, hpttl, hrandfield, hrandfield, hrandfieldWithCount, hrandfieldWithCount, hrandfieldWithCountWithValues, hrandfieldWithCountWithValues, hscan, hscan, hscan, hscan, hset, hset, hsetex, hsetex, hsetnx, hsetnx, hstrlen, hstrlen, httl, httl, hvals, hvals, incr, incr, incrBy, incrBy, incrByFloat, incrByFloat, invokeScript, invokeScript, invokeScript, isConnected, lcs, lcs, lcsIdx, lcsIdx, lcsIdx, lcsIdx, lcsIdxWithMatchLen, lcsIdxWithMatchLen, lcsIdxWithMatchLen, lcsIdxWithMatchLen, lcsLen, lcsLen, lindex, lindex, linsert, linsert, llen, llen, lmove, lmove, lmpop, lmpop, lmpop, lmpop, lpop, lpop, lpopCount, lpopCount, lpos, lpos, lpos, lpos, lposCount, lposCount, lposCount, lposCount, lpush, lpush, lpushx, lpushx, lrange, lrange, lrem, lrem, lset, lset, ltrim, ltrim, mget, mget, migrate, migrate, migrate, migrate, move, move, mset, msetBinary, msetnx, msetnxBinary, objectEncoding, objectEncoding, objectFreq, objectFreq, objectIdletime, objectIdletime, objectRefcount, objectRefcount, parseSubscriptionState, persist, persist, pexpire, pexpire, pexpire, pexpire, pexpireAt, pexpireAt, pexpireAt, pexpireAt, pexpiretime, pexpiretime, pfadd, pfadd, pfcount, pfcount, pfmerge, pfmerge, psubscribe, psubscribeLazy, pttl, pttl, publish, publish, pubsubChannels, pubsubChannels, pubsubChannels, pubsubChannelsBinary, pubsubNumPat, pubsubNumSub, pubsubNumSub, punsubscribe, punsubscribe, punsubscribeLazy, punsubscribeLazy, refreshIamToken, rename, rename, renamenx, renamenx, restore, restore, rpop, rpop, rpopCount, rpopCount, rpush, rpush, rpushx, rpushx, sadd, sadd, scard, scard, scriptDebug, scriptShow, scriptShow, sdiff, sdiff, sdiffstore, sdiffstore, set, set, set, set, setbit, setbit, setrange, setrange, sinter, sinter, sintercard, sintercard, sintercard, sintercard, sinterstore, sinterstore, sismember, sismember, smembers, smembers, smismember, smismember, smove, smove, sort, sort, sort, sort, sortReadOnly, sortReadOnly, sortReadOnly, sortReadOnly, sortStore, sortStore, sortStore, sortStore, spop, spop, spopCount, spopCount, srandmember, srandmember, srandmember, srandmember, srem, srem, sscan, sscan, sscan, sscan, strlen, strlen, subscribe, subscribeLazy, sunion, sunion, sunionstore, sunionstore, touch, touch, tryGetPubSubMessage, ttl, ttl, type, type, unlink, unlink, unsubscribe, unsubscribe, unsubscribeLazy, unsubscribeLazy, updateConnectionPassword, updateConnectionPassword, waitaof, watch, watch, xack, xack, xadd, xadd, xadd, xadd, xadd, xadd, xadd, xadd, xautoclaim, xautoclaim, xautoclaim, xautoclaim, xautoclaimJustId, xautoclaimJustId, xautoclaimJustId, xautoclaimJustId, xclaim, xclaim, xclaim, xclaim, xclaimJustId, xclaimJustId, xclaimJustId, xclaimJustId, xdel, xdel, xgroupCreate, xgroupCreate, xgroupCreate, xgroupCreate, xgroupCreateConsumer, xgroupCreateConsumer, xgroupDelConsumer, xgroupDelConsumer, xgroupDestroy, xgroupDestroy, xgroupSetId, xgroupSetId, xgroupSetId, xgroupSetId, xinfoConsumers, xinfoConsumers, xinfoGroups, xinfoGroups, xinfoStream, xinfoStream, xinfoStreamFull, xinfoStreamFull, xinfoStreamFull, xinfoStreamFull, xlen, xlen, xpending, xpending, xpending, xpending, xpending, xpending, xrange, xrange, xrange, xrange, xread, xread, xreadBinary, xreadBinary, xreadgroup, xreadgroup, xreadgroup, xreadgroup, xrevrange, xrevrange, xrevrange, xrevrange, xtrim, xtrim, zadd, zadd, zadd, zadd, zadd, zadd, zadd, zadd, zaddIncr, zaddIncr, zaddIncr, zaddIncr, zcard, zcard, zcount, zcount, zdiff, zdiff, zdiffstore, zdiffstore, zdiffWithScores, zdiffWithScores, zincrby, zincrby, zinter, zinter, zintercard, zintercard, zintercard, zintercard, zinterstore, zinterstore, zinterstore, zinterstore, zinterWithScores, zinterWithScores, zinterWithScores, zinterWithScores, zlexcount, zlexcount, zmpop, zmpop, zmpop, zmpop, zmscore, zmscore, zpopmax, zpopmax, zpopmax, zpopmax, zpopmin, zpopmin, zpopmin, zpopmin, zrandmember, zrandmember, zrandmemberWithCount, zrandmemberWithCount, zrandmemberWithCountWithScores, zrandmemberWithCountWithScores, zrange, zrange, zrange, zrange, zrangestore, zrangestore, zrangestore, zrangestore, zrangeWithScores, zrangeWithScores, zrangeWithScores, zrangeWithScores, zrank, zrank, zrankWithScore, zrankWithScore, zrem, zrem, zremrangebylex, zremrangebylex, zremrangebyrank, zremrangebyrank, zremrangebyscore, zremrangebyscore, zrevrank, zrevrank, zrevrankWithScore, zrevrankWithScore, zscan, zscan, zscan, zscan, zscore, zscore, zunion, zunion, zunionstore, zunionstore, zunionstore, zunionstore, zunionWithScores, zunionWithScores, zunionWithScores, zunionWithScores
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface glide.api.commands.ServerManagementClusterCommands
aclCat, aclCat, aclDelUser, aclDryRun, aclGenPass, aclGenPass, aclGetUser, aclList, aclLoad, aclLog, aclLog, aclSave, aclSetUser, aclUsers, aclWhoami
-
-
-
-
Constructor Detail
-
GlideClusterClient
protected GlideClusterClient(BaseClient.ClientBuilder builder)
Constructor using ClientParams from BaseClient.
-
-
Method Detail
-
createClient
public static java.util.concurrent.CompletableFuture<GlideClusterClient> createClient(@NonNull @NonNull GlideClusterClientConfiguration config)
Creates a newGlideClusterClientinstance and establishes connections to a Valkey Cluster.- Parameters:
config- The configuration options for the client, including cluster addresses, authentication credentials, TLS settings, periodic checks, and Pub/Sub subscriptions.- Returns:
- A Future that resolves to a connected
GlideClusterClientinstance. - Example:
GlideClusterClientConfiguration config = GlideClusterClientConfiguration.builder() .address(node1address) .address(node2address) .useTLS(true) .readFrom(ReadFrom.PREFER_REPLICA) .credentials(credentialsConfiguration) .requestTimeout(2000) .clientName("GLIDE") .subscriptionConfiguration( ClusterSubscriptionConfiguration.builder() .subscription(EXACT, "notifications") .subscription(EXACT, "news") .subscription(SHARDED, "data") .callback(callback) .build()) .inflightRequestsLimit(1000) .build(); GlideClusterClient client = GlideClusterClient.createClient(config).get();
-
customCommand
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> customCommand(@NonNull @NonNull java.lang.String[] args)
Description copied from interface:GenericClusterCommandsExecutes a single command, without checking inputs. Every part of the command, including subcommands, should be added as a separate value inargs.
The command will be routed automatically based on the passed command's default request policy.- Specified by:
customCommandin interfaceGenericClusterCommands- Parameters:
args- Arguments for the custom command including the command name.- Returns:
- The returned value for the custom command.
- See Also:
- Valkey GLIDE Wiki for details on the restrictions and limitations of the custom command API.
-
customCommand
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> customCommand(@NonNull @NonNull GlideString[] args)
Description copied from interface:GenericClusterCommandsExecutes a single command, without checking inputs. Every part of the command, including subcommands, should be added as a separate value inargs.
The command will be routed automatically based on the passed command's default request policy.- Specified by:
customCommandin interfaceGenericClusterCommands- Parameters:
args- Arguments for the custom command including the command name.- Returns:
- The returned value for the custom command.
- See Also:
- Valkey GLIDE Wiki for details on the restrictions and limitations of the custom command API.
-
customCommand
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> customCommand(@NonNull @NonNull java.lang.String[] args, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:GenericClusterCommandsExecutes a single command, without checking inputs. Every part of the command, including subcommands, should be added as a separate value inargs.- Specified by:
customCommandin interfaceGenericClusterCommands- Parameters:
args- Arguments for the custom command including the command nameroute- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The returning value depends on the executed command and route.
- See Also:
- Valkey GLIDE Wiki for details on the restrictions and limitations of the custom command API.
-
customCommand
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> customCommand(@NonNull @NonNull GlideString[] args, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:GenericClusterCommandsExecutes a single command, without checking inputs. Every part of the command, including subcommands, should be added as a separate value inargs.- Specified by:
customCommandin interfaceGenericClusterCommands- Parameters:
args- Arguments for the custom command including the command nameroute- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The returning value depends on the executed command and route.
- See Also:
- Valkey GLIDE Wiki for details on the restrictions and limitations of the custom command API.
-
handleCustomCommandResponse
protected ClusterValue<java.lang.Object> handleCustomCommandResponse(RequestRoutingConfiguration.Route route, ResponseOuterClass.Response response)
-
handleCustomCommandBinaryResponse
protected ClusterValue<java.lang.Object> handleCustomCommandBinaryResponse(RequestRoutingConfiguration.Route route, ResponseOuterClass.Response response)
-
exec
@Deprecated public java.util.concurrent.CompletableFuture<java.lang.Object[]> exec(@NonNull @NonNull ClusterTransaction transaction)Deprecated.- Specified by:
execin interfaceTransactionsClusterCommands- Parameters:
transaction- AClusterTransactionobject containing a list of commands to be executed.- Returns:
- A list of results corresponding to the execution of each command in the transaction.
- See Also:
TransactionsClusterCommands.exec(ClusterBatch, boolean), valkey.io documentation on Transactions
-
exec
@Deprecated public java.util.concurrent.CompletableFuture<java.lang.Object[]> exec(@NonNull @NonNull ClusterTransaction transaction, @NonNull @NonNull RequestRoutingConfiguration.SingleNodeRoute route)Deprecated.- Specified by:
execin interfaceTransactionsClusterCommands- Parameters:
transaction- AClusterTransactionobject containing a list of commands to be executed.route- A single-node routing configuration for the transaction. The client will route the transaction to the node defined byroute.- Returns:
- A list of results corresponding to the execution of each command in the transaction.
- See Also:
TransactionsClusterCommands.exec(ClusterBatch, boolean, ClusterBatchOptions), valkey.io documentation on Transactions
-
exec
public java.util.concurrent.CompletableFuture<java.lang.Object[]> exec(@NonNull @NonNull ClusterBatch batch, boolean raiseOnError)Description copied from interface:TransactionsClusterCommandsExecutes a batch by processing the queued commands.Routing Behavior:
- For atomic batches (Transactions):
- The transaction will be routed to the slot owner of the first key found in the batch.
- If no key is found, the request will be sent to a random node.
- For non-atomic batches:
- Each command will be routed to the node that owns the corresponding key's slot. If no key is present, the routing will follow the default policy for the command.
- Multi-node commands will be automatically split and sent to the respective nodes.
Notes:
- Atomic Batches (Transactions): All key-based commands must map to the
same hash slot. If keys span different slots, the transaction will fail. If the
transaction fails due to a
WATCHcommand,EXECwill returnnull.
- Specified by:
execin interfaceTransactionsClusterCommands- Parameters:
batch- AClusterBatchobject containing a list of commands to be executed.raiseOnError- Determines how errors are handled within the batch response.When set to
true, the first encountered error in the batch will be raised as an exception of typeRequestExceptionafter all retries and reconnections have been executed.When set to
false, errors will be included as part of the batch response, allowing the caller to process both successful and failed commands together. In this case, error details will be provided as instances ofRequestException.- Returns:
- A
CompletableFutureresolving to an array of results, where each entry corresponds to a command’s execution result. - See Also:
- Valkey Transactions (Atomic Batches), Valkey Pipelines (Non-Atomic Batches)
- For atomic batches (Transactions):
-
exec
public java.util.concurrent.CompletableFuture<java.lang.Object[]> exec(@NonNull @NonNull ClusterBatch batch, boolean raiseOnError, @NonNull @NonNull ClusterBatchOptions options)Description copied from interface:TransactionsClusterCommandsExecutes a batch by processing the queued commands.Routing Behavior:
- If a
routeis specified inClusterBatchOptions, the entire batch is sent to the specified node. - If no
routeis specified:- Atomic batches (Transactions): Routed to the slot owner of the first key in the batch. If no key is found, the request is sent to a random node.
- Non-atomic batches (Pipelines): Each command is routed to the node owning the corresponding key's slot. If no key is present, routing follows the command's request policy. Multi-node commands are automatically split and dispatched to the appropriate nodes.
Behavior notes:
- Atomic Batches (Transactions): All key-based commands must map to the
same hash slot. If keys span different slots, the transaction will fail. If the
transaction fails due to a
WATCHcommand,EXECwill returnnull.
Retry and Redirection:
- If a redirection error occurs:
- Atomic batches (Transactions): The entire transaction will be redirected.
- Non-atomic batches: Only commands that encountered redirection errors will be redirected.
- Retries for failures will be handled according to the configured
ClusterBatchRetryStrategy.
- Specified by:
execin interfaceTransactionsClusterCommands- Parameters:
batch- AClusterBatchcontaining the commands to execute.raiseOnError- Determines how errors are handled within the batch response.When set to
true, the first encountered error in the batch will be raised as an exception of typeRequestExceptionafter all retries and reconnections have been executed.When set to
false, errors will be included as part of the batch response, allowing the caller to process both successful and failed commands together. In this case, error details will be provided as instances ofRequestException.options- AClusterBatchOptionsobject containing execution options.- Returns:
- A
CompletableFutureresolving to an array of results, where each entry corresponds to a command’s execution result. - See Also:
- Valkey Transactions (Atomic Batches), Valkey Pipelines (Non-Atomic Batches)
- If a
-
ping
public java.util.concurrent.CompletableFuture<java.lang.String> ping()
Description copied from interface:ConnectionManagementClusterCommandsPings the server.
The command will be routed to all primary nodes.- Specified by:
pingin interfaceConnectionManagementClusterCommands- Returns:
Stringwith"PONG".- See Also:
- valkey.io for details.
-
ping
public java.util.concurrent.CompletableFuture<java.lang.String> ping(@NonNull @NonNull java.lang.String message)Description copied from interface:ConnectionManagementClusterCommandsPings the server.
The command will be routed to all primary nodes.- Specified by:
pingin interfaceConnectionManagementClusterCommands- Parameters:
message- The server will respond with a copy of the message.- Returns:
Stringwith a copy of the argumentmessage.- See Also:
- valkey.io for details.
-
ping
public java.util.concurrent.CompletableFuture<GlideString> ping(@NonNull @NonNull GlideString message)
Description copied from interface:ConnectionManagementClusterCommandsPings the server.
The command will be routed to all primary nodes.- Specified by:
pingin interfaceConnectionManagementClusterCommands- Parameters:
message- The server will respond with a copy of the message.- Returns:
GlideStringwith a copy of the argumentmessage.- See Also:
- valkey.io for details.
-
ping
public java.util.concurrent.CompletableFuture<java.lang.String> ping(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ConnectionManagementClusterCommandsPings the server.- Specified by:
pingin interfaceConnectionManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
Stringwith"PONG".- See Also:
- valkey.io for details.
-
ping
public java.util.concurrent.CompletableFuture<java.lang.String> ping(@NonNull @NonNull java.lang.String message, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ConnectionManagementClusterCommandsPings the server.- Specified by:
pingin interfaceConnectionManagementClusterCommands- Parameters:
message- The ping argument that will be returned.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
Stringwith a copy of the argumentmessage.- See Also:
- valkey.io for details.
-
ping
public java.util.concurrent.CompletableFuture<GlideString> ping(@NonNull @NonNull GlideString message, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ConnectionManagementClusterCommandsPings the server.- Specified by:
pingin interfaceConnectionManagementClusterCommands- Parameters:
message- The ping argument that will be returned.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
GlideStringwith a copy of the argumentmessage.- See Also:
- valkey.io for details.
-
info
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> info()
Description copied from interface:ServerManagementClusterCommandsGets information and statistics about the server using theInfoOptions.Section.DEFAULToption. The command will be routed to all primary nodes.- Specified by:
infoin interfaceServerManagementClusterCommands- Returns:
- A
Map<String, String>with each address as the key and its corresponding value is the information for the node. - See Also:
- valkey.io for details.
-
info
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> info(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsGets information and statistics about the server. If no argument is provided, so theInfoOptions.Section.DEFAULToption is assumed.- Specified by:
infoin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
Stringcontaining the information for the default sections. When specifying arouteother than a single node, it returns aMap<String, String>with each address as the key and its corresponding value is the information for the node. - See Also:
- valkey.io for details.
-
info
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> info(@NonNull @NonNull InfoOptions.Section[] sections)
Description copied from interface:ServerManagementClusterCommandsGets information and statistics about the server.
Starting from server version 7, command supports multiple section arguments.
The command will be routed to all primary nodes.- Specified by:
infoin interfaceServerManagementClusterCommands- Parameters:
sections- A list ofInfoOptions.Sectionvalues specifying which sections of information to retrieve. When no parameter is provided, theInfoOptions.Section.DEFAULToption is assumed.- Returns:
- A
Map<String, String>with each address as the key and its corresponding value is the information of the sections requested for the node. - See Also:
- valkey.io for details.
-
select
public java.util.concurrent.CompletableFuture<java.lang.String> select(long index)
Description copied from interface:ConnectionManagementClusterCommandsChanges the currently selected database.- Specified by:
selectin interfaceConnectionManagementClusterCommands- Parameters:
index- The index of the database to select.- Returns:
- A simple
OKresponse. - See Also:
- valkey.io for details.
-
clientPause
public java.util.concurrent.CompletableFuture<java.lang.String> clientPause(long timeout)
Description copied from interface:ConnectionManagementClusterCommandsSuspends all clients for the specified timeout.
The command will be routed to all primary nodes.- Specified by:
clientPausein interfaceConnectionManagementClusterCommands- Parameters:
timeout- The time in milliseconds to pause clients.- Returns:
OK.- See Also:
- valkey.io for details.
-
clientPause
public java.util.concurrent.CompletableFuture<java.lang.String> clientPause(long timeout, @NonNull @NonNull ClientPauseMode mode)Description copied from interface:ConnectionManagementClusterCommandsSuspends all clients for the specified timeout.
The command will be routed to all primary nodes.- Specified by:
clientPausein interfaceConnectionManagementClusterCommands- Parameters:
timeout- The time in milliseconds to pause clients.mode- The pause mode to use.- Returns:
OK.- See Also:
- valkey.io for details.
-
clientPause
public java.util.concurrent.CompletableFuture<java.lang.String> clientPause(long timeout, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ConnectionManagementClusterCommandsSuspends all clients for the specified timeout.
The command will be routed to the nodes defined byroute.- Specified by:
clientPausein interfaceConnectionManagementClusterCommands- Parameters:
timeout- The time in milliseconds to pause clients.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
clientPause
public java.util.concurrent.CompletableFuture<java.lang.String> clientPause(long timeout, @NonNull @NonNull ClientPauseMode mode, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ConnectionManagementClusterCommandsSuspends all clients for the specified timeout.
The command will be routed to the nodes defined byroute.- Specified by:
clientPausein interfaceConnectionManagementClusterCommands- Parameters:
timeout- The time in milliseconds to pause clients.mode- The pause mode to use.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
clientUnpause
public java.util.concurrent.CompletableFuture<java.lang.String> clientUnpause()
Description copied from interface:ConnectionManagementClusterCommandsResumes processing commands on all clients.
The command will be routed to all primary nodes.- Specified by:
clientUnpausein interfaceConnectionManagementClusterCommands- Returns:
OK.- See Also:
- valkey.io for details.
-
clientUnpause
public java.util.concurrent.CompletableFuture<java.lang.String> clientUnpause(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ConnectionManagementClusterCommandsResumes processing commands on all clients.
The command will be routed to the nodes defined byroute.- Specified by:
clientUnpausein interfaceConnectionManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
reset
public java.util.concurrent.CompletableFuture<java.lang.String> reset()
Description copied from interface:ConnectionManagementClusterCommandsResets the connection state.- Specified by:
resetin interfaceConnectionManagementClusterCommands- Returns:
Stringwith"RESET".- See Also:
- valkey.io for details.
-
info
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> info(@NonNull @NonNull InfoOptions.Section[] sections, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsGets information and statistics about the server.
Starting from server version 7, command supports multiple section arguments.- Specified by:
infoin interfaceServerManagementClusterCommands- Parameters:
sections- A list ofInfoOptions.Sectionvalues specifying which sections of information to retrieve. When no parameter is provided, theInfoOptions.Section.DEFAULToption is assumed.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
Stringwith the containing the information for the sections requested. When specifying arouteother than a single node, it returns aMap<String, String>with each address as the key and its corresponding value is the information of the sections requested for the node. - See Also:
- valkey.io for details.
-
clientId
public java.util.concurrent.CompletableFuture<java.lang.Long> clientId()
Description copied from interface:ConnectionManagementClusterCommandsGets the current connection id.
The command will be routed to a random node.- Specified by:
clientIdin interfaceConnectionManagementClusterCommands- Returns:
- The id of the client.
- See Also:
- valkey.io for details.
-
clientId
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Long>> clientId(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ConnectionManagementClusterCommandsGets the current connection id.- Specified by:
clientIdin interfaceConnectionManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
ClusterValuewhich holds a single value if single node route is used or a dictionary where each address is the key and its corresponding node response is the value. The value is the id of the client on that node. - See Also:
- valkey.io for details.
-
clientGetName
public java.util.concurrent.CompletableFuture<java.lang.String> clientGetName()
Description copied from interface:ConnectionManagementClusterCommandsGets the name of the current connection.
The command will be routed a random node.- Specified by:
clientGetNamein interfaceConnectionManagementClusterCommands- Returns:
- The name of the client connection as a string if a name is set, or
nullif no name is assigned. - See Also:
- valkey.io for details.
-
clientGetName
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> clientGetName(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ConnectionManagementClusterCommandsGets the name of the current connection.- Specified by:
clientGetNamein interfaceConnectionManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
ClusterValuewhich holds a single value if single node route is used or a dictionary where each address is the key and its corresponding node response is the value. The value is the name of the client connection as a string if a name is set, or null if no name is assigned. - See Also:
- valkey.io for details.
-
clientTrackingInfo
public java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>> clientTrackingInfo()
Description copied from interface:ConnectionManagementClusterCommandsReturns information about the current client connection's use of the server assisted client side caching feature.Routes to a random node by default. To specify routing, use
ConnectionManagementClusterCommands.clientTrackingInfo(Route).- Specified by:
clientTrackingInfoin interfaceConnectionManagementClusterCommands- Returns:
- A
Mapwith the client's tracking state. The map contains:flags: aSetof tracking flags. See valkey.io for the full list.redirect: aLongwith the client ID receiving invalidation messages, or-1if not redirectingprefixes: anObject[]of key prefixes monitored for invalidation
- See Also:
- valkey.io for details.
-
clientTrackingInfo
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>>> clientTrackingInfo(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ConnectionManagementClusterCommandsReturns information about the current client connection's use of the server assisted client side caching feature.- Specified by:
clientTrackingInfoin interfaceConnectionManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command.- Returns:
- A
ClusterValuecontaining the tracking state map per the routing.- For a
RequestRoutingConfiguration.SingleNodeRoute: a singleMapwhere:flags: aSetof tracking flags. See valkey.io for the full list.redirect: aLongwith the client ID receiving invalidation messages, or-1if not redirectingprefixes: anObject[]of key prefixes monitored for invalidation
- For a multi-node route: a
Mapof node address to tracking state map.
- For a
- See Also:
- valkey.io for details.
-
configRewrite
public java.util.concurrent.CompletableFuture<java.lang.String> configRewrite()
Description copied from interface:ServerManagementClusterCommandsRewrites the configuration file with the current configuration.
The command will be routed automatically to all nodes.- Specified by:
configRewritein interfaceServerManagementClusterCommands- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
configRewrite
public java.util.concurrent.CompletableFuture<java.lang.String> configRewrite(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsRewrites the configuration file with the current configuration.- Specified by:
configRewritein interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
configResetStat
public java.util.concurrent.CompletableFuture<java.lang.String> configResetStat()
Description copied from interface:ServerManagementClusterCommandsResets the statistics reported by the server using the INFO and LATENCY HISTOGRAM commands.
The command will be routed automatically to all nodes.- Specified by:
configResetStatin interfaceServerManagementClusterCommands- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
configResetStat
public java.util.concurrent.CompletableFuture<java.lang.String> configResetStat(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsResets the statistics reported by the server using the INFO and LATENCY HISTOGRAM commands.- Specified by:
configResetStatin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
configGet
public java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.String>> configGet(@NonNull @NonNull java.lang.String[] parameters)Description copied from interface:ServerManagementClusterCommandsGet the values of configuration parameters.
Starting from server version 7, command supports multiple parameters.
The command will be sent to a random node.- Specified by:
configGetin interfaceServerManagementClusterCommands- Parameters:
parameters- Anarrayof configuration parameter names to retrieve values for.- Returns:
- A
mapof values corresponding to the configuration parameters. - See Also:
- valkey.io for details.
-
configGet
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.String>>> configGet(@NonNull @NonNull java.lang.String[] parameters, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsGet the values of configuration parameters.
Starting from server version 7, command supports multiple parameters.- Specified by:
configGetin interfaceServerManagementClusterCommands- Parameters:
parameters- Anarrayof configuration parameter names to retrieve values for.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
mapof values corresponding to the configuration parameters.
When specifying a route other than a single node, it returns a dictionary where each address is the key and its corresponding node response is the value. - See Also:
- valkey.io for details.
-
configSet
public java.util.concurrent.CompletableFuture<java.lang.String> configSet(@NonNull @NonNull java.util.Map<java.lang.String,java.lang.String> parameters)Description copied from interface:ServerManagementClusterCommandsSets configuration parameters to the specified values.
Starting from server version 7, command supports multiple parameters.
The command will be sent to all nodes.- Specified by:
configSetin interfaceServerManagementClusterCommands- Parameters:
parameters- Amapconsisting of configuration parameters and their respective values to set.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
configSet
public java.util.concurrent.CompletableFuture<java.lang.String> configSet(@NonNull @NonNull java.util.Map<java.lang.String,java.lang.String> parameters, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsSets configuration parameters to the specified values.
Starting from server version 7, command supports multiple parameters.- Specified by:
configSetin interfaceServerManagementClusterCommands- Parameters:
parameters- Amapconsisting of configuration parameters and their respective values to set.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
echo
public java.util.concurrent.CompletableFuture<java.lang.String> echo(@NonNull @NonNull java.lang.String message)Description copied from interface:ConnectionManagementClusterCommandsEchoes the providedmessageback.
The command will be routed a random node.- Specified by:
echoin interfaceConnectionManagementClusterCommands- Parameters:
message- The message to be echoed back.- Returns:
- The provided
message. - See Also:
- valkey.io for details.
-
echo
public java.util.concurrent.CompletableFuture<GlideString> echo(@NonNull @NonNull GlideString message)
Description copied from interface:ConnectionManagementClusterCommandsEchoes the providedmessageback.
The command will be routed a random node.- Specified by:
echoin interfaceConnectionManagementClusterCommands- Parameters:
message- The message to be echoed back.- Returns:
- The provided
message. - See Also:
- valkey.io for details.
-
echo
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> echo(@NonNull @NonNull java.lang.String message, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ConnectionManagementClusterCommandsEchoes the providedmessageback.- Specified by:
echoin interfaceConnectionManagementClusterCommands- Parameters:
message- The message to be echoed back.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The provided
message. - See Also:
- valkey.io for details.
-
echo
public java.util.concurrent.CompletableFuture<ClusterValue<GlideString>> echo(@NonNull @NonNull GlideString message, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ConnectionManagementClusterCommandsEchoes the providedmessageback.- Specified by:
echoin interfaceConnectionManagementClusterCommands- Parameters:
message- The message to be echoed back.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The provided
message. - See Also:
- valkey.io for details.
-
time
public java.util.concurrent.CompletableFuture<java.lang.String[]> time()
Description copied from interface:ServerManagementClusterCommandsReturns the server time.
The command will be routed to a random node.- Specified by:
timein interfaceServerManagementClusterCommands- Returns:
- The current server time as a
Stringarray with two elements: AUNIX TIMEand the amount of microseconds already elapsed in the current second. The returned array is in a[UNIX TIME, Microseconds already elapsed]format. - See Also:
- valkey.io for details.
-
time
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String[]>> time(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsReturns the server time.- Specified by:
timein interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The current server time as a
Stringarray with two elements: AUNIX TIMEand the amount of microseconds already elapsed in the current second. The returned array is in a[UNIX TIME, Microseconds already elapsed]format. - See Also:
- valkey.io for details.
-
lastsave
public java.util.concurrent.CompletableFuture<java.lang.Long> lastsave()
Description copied from interface:ServerManagementClusterCommandsReturnsUNIX TIMEof the last DB save timestamp or startup timestamp if no save was made since then.
The command will be routed to a random node.- Specified by:
lastsavein interfaceServerManagementClusterCommands- Returns:
UNIX TIMEof the last DB save executed with success.- See Also:
- valkey.io for details.
-
lastsave
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Long>> lastsave(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsReturnsUNIX TIMEof the last DB save timestamp or startup timestamp if no save was made since then.- Specified by:
lastsavein interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
UNIX TIMEof the last DB save executed with success.- See Also:
- valkey.io for details.
-
latencyHistory
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[][]>> latencyHistory(@NonNull @NonNull java.lang.String event)
Description copied from interface:ServerManagementClusterCommandsReturns the latency spike time series for the specified event.
The command will be routed to all primary nodes.- Specified by:
latencyHistoryin interfaceServerManagementClusterCommands- Parameters:
event- The name of the latency event (e.g., "command").- Returns:
- A cluster value containing array(s) of arrays representing latency spike entries, or an empty array if the event doesn't exist.
- See Also:
- valkey.io for details.
-
latencyHistory
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[][]>> latencyHistory(@NonNull @NonNull java.lang.String event, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsReturns the latency spike time series for the specified event.- Specified by:
latencyHistoryin interfaceServerManagementClusterCommands- Parameters:
event- The name of the latency event (e.g., "command").route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A cluster value containing array(s) of arrays representing latency spike entries, or an empty array if the event doesn't exist.
- See Also:
- valkey.io for details.
-
latencyLatest
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[][]>> latencyLatest()
Description copied from interface:ServerManagementClusterCommandsReports the latest latency events logged by the server.
The command will be routed to all primary nodes.- Specified by:
latencyLatestin interfaceServerManagementClusterCommands- Returns:
- A cluster value containing array(s) of arrays representing latency event info.
- See Also:
- valkey.io for details.
-
latencyLatest
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[][]>> latencyLatest(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsReports the latest latency events logged by the server.- Specified by:
latencyLatestin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A cluster value containing array(s) of arrays representing latency event info.
- See Also:
- valkey.io for details.
-
latencyReset
public java.util.concurrent.CompletableFuture<java.lang.Long> latencyReset()
Description copied from interface:ServerManagementClusterCommandsResets the latency spike time series for all events.
The command will be routed to all primary nodes.- Specified by:
latencyResetin interfaceServerManagementClusterCommands- Returns:
- The total number of event time series that were reset across all nodes.
- See Also:
- valkey.io for details.
-
latencyReset
public java.util.concurrent.CompletableFuture<java.lang.Long> latencyReset(@NonNull @NonNull java.lang.String[] events)Description copied from interface:ServerManagementClusterCommandsResets the latency spike time series for the specified events.
Ifeventsis empty, resets the latency spike time series for all events.
The command will be routed to all primary nodes.- Specified by:
latencyResetin interfaceServerManagementClusterCommands- Parameters:
events- The event names to reset.- Returns:
- The total number of event time series that were reset across all nodes.
- See Also:
- valkey.io for details.
-
latencyReset
public java.util.concurrent.CompletableFuture<java.lang.Long> latencyReset(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsResets the latency spike time series for all events.- Specified by:
latencyResetin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The total number of event time series that were reset.
- See Also:
- valkey.io for details.
-
latencyReset
public java.util.concurrent.CompletableFuture<java.lang.Long> latencyReset(@NonNull @NonNull java.lang.String[] events, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsResets the latency spike time series for the specified events.
Ifeventsis empty, resets the latency spike time series for all events.- Specified by:
latencyResetin interfaceServerManagementClusterCommands- Parameters:
events- The event names to reset.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The total number of event time series that were reset.
- See Also:
- valkey.io for details.
-
memoryDoctor
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> memoryDoctor()
Description copied from interface:ServerManagementClusterCommandsReturns a report about memory problems detected by the server.
The command will be routed to all primary nodes by default.- Specified by:
memoryDoctorin interfaceServerManagementClusterCommands- Returns:
- A cluster value containing the memory diagnostic report(s).
- See Also:
- valkey.io for details.
-
memoryDoctor
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> memoryDoctor(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsReturns a report about memory problems detected by the server.- Specified by:
memoryDoctorin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A cluster value containing the memory diagnostic report(s).
- See Also:
- valkey.io for details.
-
memoryMallocStats
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> memoryMallocStats()
Description copied from interface:ServerManagementClusterCommandsReturns the internal statistics of the memory allocator.
The command will be routed to all primary nodes by default.- Specified by:
memoryMallocStatsin interfaceServerManagementClusterCommands- Returns:
- A cluster value containing the memory allocator statistics.
- See Also:
- valkey.io for details.
-
memoryMallocStats
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> memoryMallocStats(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsReturns the internal statistics of the memory allocator.- Specified by:
memoryMallocStatsin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A cluster value containing the memory allocator statistics.
- See Also:
- valkey.io for details.
-
memoryPurge
public java.util.concurrent.CompletableFuture<java.lang.String> memoryPurge()
Description copied from interface:ServerManagementClusterCommandsAsks the server to reclaim memory from the allocator back to the operating system.
The command will be routed to all primary nodes by default.- Specified by:
memoryPurgein interfaceServerManagementClusterCommands- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
memoryPurge
public java.util.concurrent.CompletableFuture<java.lang.String> memoryPurge(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsAsks the server to reclaim memory from the allocator back to the operating system.- Specified by:
memoryPurgein interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
memoryStats
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>>> memoryStats()
Description copied from interface:ServerManagementClusterCommandsReturns detailed memory consumption statistics of the server.
The command will be routed to all primary nodes by default.- Specified by:
memoryStatsin interfaceServerManagementClusterCommands- Returns:
- A cluster value containing a map of memory statistics.
- See Also:
- valkey.io for details.
-
memoryStats
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>>> memoryStats(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsReturns detailed memory consumption statistics of the server.- Specified by:
memoryStatsin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A cluster value containing a map of memory statistics.
- See Also:
- valkey.io for details.
-
save
public java.util.concurrent.CompletableFuture<java.lang.String> save()
Description copied from interface:ServerManagementClusterCommandsSynchronously saves the dataset to disk.
The command will be routed to all primary nodes.- Specified by:
savein interfaceServerManagementClusterCommands- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
save
public java.util.concurrent.CompletableFuture<java.lang.String> save(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsSynchronously saves the dataset to disk.
The command will be routed to the nodes defined byroute.- Specified by:
savein interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
bgsave
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> bgsave()
Description copied from interface:ServerManagementClusterCommandsAsynchronously saves the dataset to disk in the background.
The command will be routed to all primary nodes.- Specified by:
bgsavein interfaceServerManagementClusterCommands- Returns:
- A
ClusterValue<String>containing status strings. - See Also:
- valkey.io for details.
-
bgsave
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> bgsave(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsAsynchronously saves the dataset to disk in the background.
The command will be routed to the nodes defined byroute.- Specified by:
bgsavein interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
ClusterValue<String>containing status strings. - See Also:
- valkey.io for details.
-
bgsaveSchedule
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> bgsaveSchedule()
Description copied from interface:ServerManagementClusterCommandsSchedules a background save of the database.
The command will be routed to all primary nodes.- Specified by:
bgsaveSchedulein interfaceServerManagementClusterCommands- Returns:
- A
ClusterValue<String>containing status strings. - See Also:
- valkey.io for details.
-
bgsaveSchedule
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> bgsaveSchedule(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsSchedules a background save of the database.
The command will be routed to the nodes defined byroute.- Specified by:
bgsaveSchedulein interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
ClusterValue<String>containing status strings. - See Also:
- valkey.io for details.
-
bgsaveCancel
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> bgsaveCancel()
Description copied from interface:ServerManagementClusterCommandsAborts all in-progress and scheduled background saves.
The command will be routed to all primary nodes.- Specified by:
bgsaveCancelin interfaceServerManagementClusterCommands- Returns:
- A
ClusterValue<String>containing status strings. - See Also:
- valkey.io for details.
-
bgsaveCancel
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> bgsaveCancel(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsAborts all in-progress and scheduled background saves.
The command will be routed to the nodes defined byroute.- Specified by:
bgsaveCancelin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
ClusterValue<String>containing status strings. - See Also:
- valkey.io for details.
-
bgrewriteaof
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> bgrewriteaof()
Description copied from interface:ServerManagementClusterCommandsInitiates a background rewrite of the append-only file (AOF).
The command will be routed to all primary nodes.- Specified by:
bgrewriteaofin interfaceServerManagementClusterCommands- Returns:
- A
ClusterValue<String>containing status strings. - See Also:
- valkey.io for details.
-
bgrewriteaof
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> bgrewriteaof(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsInitiates a background rewrite of the append-only file (AOF).
The command will be routed to the nodes defined byroute.- Specified by:
bgrewriteaofin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
ClusterValue<String>containing status strings. - See Also:
- valkey.io for details.
-
flushall
public java.util.concurrent.CompletableFuture<java.lang.String> flushall()
Description copied from interface:ServerManagementClusterCommandsDeletes all the keys of all the existing databases. This command never fails.
The command will be routed to all primary nodes.- Specified by:
flushallin interfaceServerManagementClusterCommands- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
flushall
public java.util.concurrent.CompletableFuture<java.lang.String> flushall(@NonNull @NonNull FlushMode mode)Description copied from interface:ServerManagementClusterCommandsDeletes all the keys of all the existing databases. This command never fails.
The command will be routed to all primary nodes.- Specified by:
flushallin interfaceServerManagementClusterCommands- Parameters:
mode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
flushall
public java.util.concurrent.CompletableFuture<java.lang.String> flushall(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsDeletes all the keys of all the existing databases. This command never fails.- Specified by:
flushallin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
flushall
public java.util.concurrent.CompletableFuture<java.lang.String> flushall(@NonNull @NonNull FlushMode mode, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsDeletes all the keys of all the existing databases. This command never fails.- Specified by:
flushallin interfaceServerManagementClusterCommands- Parameters:
mode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
flushdb
public java.util.concurrent.CompletableFuture<java.lang.String> flushdb()
Description copied from interface:ServerManagementClusterCommandsDeletes all the keys of the currently selected database. This command never fails.
The command will be routed to all primary nodes.- Specified by:
flushdbin interfaceServerManagementClusterCommands- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
flushdb
public java.util.concurrent.CompletableFuture<java.lang.String> flushdb(@NonNull @NonNull FlushMode mode)Description copied from interface:ServerManagementClusterCommandsDeletes all the keys of the currently selected database. This command never fails.
The command will be routed to all primary nodes.- Specified by:
flushdbin interfaceServerManagementClusterCommands- Parameters:
mode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
flushdb
public java.util.concurrent.CompletableFuture<java.lang.String> flushdb(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsDeletes all the keys of the currently selected database. This command never fails.- Specified by:
flushdbin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
flushdb
public java.util.concurrent.CompletableFuture<java.lang.String> flushdb(@NonNull @NonNull FlushMode mode, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsDeletes all the keys of the currently selected database. This command never fails.- Specified by:
flushdbin interfaceServerManagementClusterCommands- Parameters:
mode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
"OK"response on success.- See Also:
- valkey.io for details.
-
lolwut
public java.util.concurrent.CompletableFuture<java.lang.String> lolwut()
Description copied from interface:ServerManagementClusterCommandsDisplays a piece of generative computer art and the Valkey version.
The command will be routed to a random node.- Specified by:
lolwutin interfaceServerManagementClusterCommands- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
-
lolwut
public java.util.concurrent.CompletableFuture<java.lang.String> lolwut(int @NonNull [] parameters)
Description copied from interface:ServerManagementClusterCommandsDisplays a piece of generative computer art and the Valkey version.
The command will be routed to a random node.- Specified by:
lolwutin interfaceServerManagementClusterCommands- Parameters:
parameters- Additional set of arguments in order to change the output:- On Valkey version
5, those are length of the line, number of squares per row, and number of squares per column. - On Valkey version
6, those are number of columns and number of lines. - On other versions parameters are ignored.
- On Valkey version
- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
-
lolwut
public java.util.concurrent.CompletableFuture<java.lang.String> lolwut(int version)
Description copied from interface:ServerManagementClusterCommandsDisplays a piece of generative computer art and the Valkey version.
The command will be routed to a random node.- Specified by:
lolwutin interfaceServerManagementClusterCommands- Parameters:
version- Version of computer art to generate.- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
-
lolwut
public java.util.concurrent.CompletableFuture<java.lang.String> lolwut(int version, int @NonNull [] parameters)Description copied from interface:ServerManagementClusterCommandsDisplays a piece of generative computer art and the Valkey version.
The command will be routed to a random node.- Specified by:
lolwutin interfaceServerManagementClusterCommands- Parameters:
version- Version of computer art to generate.parameters- Additional set of arguments in order to change the output:- For version
5, those are length of the line, number of squares per row, and number of squares per column. - For version
6, those are number of columns and number of lines.
- For version
- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
-
lolwut
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> lolwut(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsDisplays a piece of generative computer art and the Valkey version.- Specified by:
lolwutin interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
-
lolwut
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> lolwut(int @NonNull [] parameters, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsDisplays a piece of generative computer art and the Valkey version.- Specified by:
lolwutin interfaceServerManagementClusterCommands- Parameters:
parameters- Additional set of arguments in order to change the output:- On Valkey version
5, those are length of the line, number of squares per row, and number of squares per column. - On Valkey version
6, those are number of columns and number of lines. - On other versions parameters are ignored.
- On Valkey version
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
-
lolwut
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> lolwut(int version, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsDisplays a piece of generative computer art and the Valkey version.- Specified by:
lolwutin interfaceServerManagementClusterCommands- Parameters:
version- Version of computer art to generate.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
-
lolwut
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> lolwut(int version, int @NonNull [] parameters, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ServerManagementClusterCommandsDisplays a piece of generative computer art and the Valkey version.- Specified by:
lolwutin interfaceServerManagementClusterCommands- Parameters:
version- Version of computer art to generate.parameters- Additional set of arguments in order to change the output:- For version
5, those are length of the line, number of squares per row, and number of squares per column. - For version
6, those are number of columns and number of lines.
- For version
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A piece of generative computer art along with the current Valkey version.
- See Also:
- valkey.io for details.
-
dbsize
public java.util.concurrent.CompletableFuture<java.lang.Long> dbsize()
Description copied from interface:ServerManagementClusterCommandsReturns the number of keys in the database.
The command will be routed to all primary nodes.- Specified by:
dbsizein interfaceServerManagementClusterCommands- Returns:
- The total number of keys across the primary nodes.
- See Also:
- valkey.io for details.
-
dbsize
public java.util.concurrent.CompletableFuture<java.lang.Long> dbsize(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsReturns the number of keys in the database.- Specified by:
dbsizein interfaceServerManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The number of keys in the database.
If the query is routed to multiple nodes, returns the sum of the number of keys across all routed nodes. - See Also:
- valkey.io for details.
-
functionLoad
public java.util.concurrent.CompletableFuture<java.lang.String> functionLoad(@NonNull @NonNull java.lang.String libraryCode, boolean replace)Description copied from interface:ScriptingAndFunctionsClusterCommandsLoads a library to Valkey.
The command will be routed to all primary nodes.- Specified by:
functionLoadin interfaceScriptingAndFunctionsClusterCommands- Parameters:
libraryCode- The source code that implements the library.replace- Whether the given library should overwrite a library with the same name if it already exists.- Returns:
- The library name that was loaded.
- See Also:
- valkey.io for details.
-
functionLoad
public java.util.concurrent.CompletableFuture<GlideString> functionLoad(@NonNull @NonNull GlideString libraryCode, boolean replace)
Description copied from interface:ScriptingAndFunctionsClusterCommandsLoads a library to Valkey.
The command will be routed to all primary nodes.- Specified by:
functionLoadin interfaceScriptingAndFunctionsClusterCommands- Parameters:
libraryCode- The source code that implements the library.replace- Whether the given library should overwrite a library with the same name if it already exists.- Returns:
- The library name that was loaded.
- See Also:
- valkey.io for details.
-
functionLoad
public java.util.concurrent.CompletableFuture<java.lang.String> functionLoad(@NonNull @NonNull java.lang.String libraryCode, boolean replace, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsLoads a library to Valkey.- Specified by:
functionLoadin interfaceScriptingAndFunctionsClusterCommands- Parameters:
libraryCode- The source code that implements the library.replace- Whether the given library should overwrite a library with the same name if it already exists.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The library name that was loaded.
- See Also:
- valkey.io for details.
-
functionLoad
public java.util.concurrent.CompletableFuture<GlideString> functionLoad(@NonNull @NonNull GlideString libraryCode, boolean replace, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsLoads a library to Valkey.- Specified by:
functionLoadin interfaceScriptingAndFunctionsClusterCommands- Parameters:
libraryCode- The source code that implements the library.replace- Whether the given library should overwrite a library with the same name if it already exists.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The library name that was loaded.
- See Also:
- valkey.io for details.
-
handleFunctionListResponse
protected ClusterValue<java.util.Map<java.lang.String,java.lang.Object>[]> handleFunctionListResponse(ResponseOuterClass.Response response, RequestRoutingConfiguration.Route route)
Process aFUNCTION LISTcluster response.
-
handleFunctionListResponseBinary
protected ClusterValue<java.util.Map<GlideString,java.lang.Object>[]> handleFunctionListResponseBinary(ResponseOuterClass.Response response, RequestRoutingConfiguration.Route route)
Process aFUNCTION LISTcluster response.
-
functionList
public java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>[]> functionList(boolean withCode)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the functions and libraries.
The command will be routed to a random node.- Specified by:
functionListin interfaceScriptingAndFunctionsClusterCommands- Parameters:
withCode- Specifies whether to request the library code from the server or not.- Returns:
- Info about all libraries and their functions.
- See Also:
- valkey.io for details.
-
functionListBinary
public java.util.concurrent.CompletableFuture<java.util.Map<GlideString,java.lang.Object>[]> functionListBinary(boolean withCode)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the functions and libraries.
The command will be routed to a random node.- Specified by:
functionListBinaryin interfaceScriptingAndFunctionsClusterCommands- Parameters:
withCode- Specifies whether to request the library code from the server or not.- Returns:
- Info about all libraries and their functions.
- See Also:
- valkey.io for details.
-
functionList
public java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Object>[]> functionList(@NonNull @NonNull java.lang.String libNamePattern, boolean withCode)Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the functions and libraries.
The command will be routed to a random node.- Specified by:
functionListin interfaceScriptingAndFunctionsClusterCommands- Parameters:
libNamePattern- A wildcard pattern for matching library names.withCode- Specifies whether to request the library code from the server or not.- Returns:
- Info about queried libraries and their functions.
- See Also:
- valkey.io for details.
-
functionListBinary
public java.util.concurrent.CompletableFuture<java.util.Map<GlideString,java.lang.Object>[]> functionListBinary(@NonNull @NonNull GlideString libNamePattern, boolean withCode)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the functions and libraries.
The command will be routed to a random node.- Specified by:
functionListBinaryin interfaceScriptingAndFunctionsClusterCommands- Parameters:
libNamePattern- A wildcard pattern for matching library names.withCode- Specifies whether to request the library code from the server or not.- Returns:
- Info about queried libraries and their functions.
- See Also:
- valkey.io for details.
-
functionList
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>[]>> functionList(boolean withCode, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the functions and libraries.- Specified by:
functionListin interfaceScriptingAndFunctionsClusterCommands- Parameters:
withCode- Specifies whether to request the library code from the server or not.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- Info about all libraries and their functions.
- See Also:
- valkey.io for details.
-
functionListBinary
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<GlideString,java.lang.Object>[]>> functionListBinary(boolean withCode, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the functions and libraries.- Specified by:
functionListBinaryin interfaceScriptingAndFunctionsClusterCommands- Parameters:
withCode- Specifies whether to request the library code from the server or not.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- Info about all libraries and their functions.
- See Also:
- valkey.io for details.
-
functionList
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.lang.Object>[]>> functionList(@NonNull @NonNull java.lang.String libNamePattern, boolean withCode, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the functions and libraries.- Specified by:
functionListin interfaceScriptingAndFunctionsClusterCommands- Parameters:
libNamePattern- A wildcard pattern for matching library names.withCode- Specifies whether to request the library code from the server or not.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- Info about queried libraries and their functions.
- See Also:
- valkey.io for details.
-
functionListBinary
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<GlideString,java.lang.Object>[]>> functionListBinary(@NonNull @NonNull GlideString libNamePattern, boolean withCode, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the functions and libraries.- Specified by:
functionListBinaryin interfaceScriptingAndFunctionsClusterCommands- Parameters:
libNamePattern- A wildcard pattern for matching library names.withCode- Specifies whether to request the library code from the server or not.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- Info about queried libraries and their functions.
- See Also:
- valkey.io for details.
-
functionFlush
public java.util.concurrent.CompletableFuture<java.lang.String> functionFlush()
Description copied from interface:ScriptingAndFunctionsClusterCommandsDeletes all function libraries.
The command will be routed to all primary nodes.- Specified by:
functionFlushin interfaceScriptingAndFunctionsClusterCommands- Returns:
OK.- See Also:
- valkey.io for details.
-
functionFlush
public java.util.concurrent.CompletableFuture<java.lang.String> functionFlush(@NonNull @NonNull FlushMode mode)Description copied from interface:ScriptingAndFunctionsClusterCommandsDeletes all function libraries.
The command will be routed to all primary nodes.- Specified by:
functionFlushin interfaceScriptingAndFunctionsClusterCommands- Parameters:
mode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.- Returns:
OK.- See Also:
- valkey.io for details.
-
functionFlush
public java.util.concurrent.CompletableFuture<java.lang.String> functionFlush(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsDeletes all function libraries.- Specified by:
functionFlushin interfaceScriptingAndFunctionsClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
functionFlush
public java.util.concurrent.CompletableFuture<java.lang.String> functionFlush(@NonNull @NonNull FlushMode mode, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsDeletes all function libraries.- Specified by:
functionFlushin interfaceScriptingAndFunctionsClusterCommands- Parameters:
mode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
functionDelete
public java.util.concurrent.CompletableFuture<java.lang.String> functionDelete(@NonNull @NonNull java.lang.String libName)Description copied from interface:ScriptingAndFunctionsClusterCommandsDeletes a library and all its functions.
The command will be routed to all primary nodes.- Specified by:
functionDeletein interfaceScriptingAndFunctionsClusterCommands- Parameters:
libName- The library name to delete.- Returns:
OK.- See Also:
- valkey.io for details.
-
functionDelete
public java.util.concurrent.CompletableFuture<java.lang.String> functionDelete(@NonNull @NonNull GlideString libName)Description copied from interface:ScriptingAndFunctionsClusterCommandsDeletes a library and all its functions.
The command will be routed to all primary nodes.- Specified by:
functionDeletein interfaceScriptingAndFunctionsClusterCommands- Parameters:
libName- The library name to delete.- Returns:
OK.- See Also:
- valkey.io for details.
-
functionDelete
public java.util.concurrent.CompletableFuture<java.lang.String> functionDelete(@NonNull @NonNull java.lang.String libName, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsDeletes a library and all its functions.- Specified by:
functionDeletein interfaceScriptingAndFunctionsClusterCommands- Parameters:
libName- The library name to delete.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
functionDelete
public java.util.concurrent.CompletableFuture<java.lang.String> functionDelete(@NonNull @NonNull GlideString libName, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsDeletes a library and all its functions.- Specified by:
functionDeletein interfaceScriptingAndFunctionsClusterCommands- Parameters:
libName- The library name to delete.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
functionDump
public java.util.concurrent.CompletableFuture<byte[]> functionDump()
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns the serialized payload of all loaded libraries.
The command will be routed to a random node.- Specified by:
functionDumpin interfaceScriptingAndFunctionsClusterCommands- Returns:
- The serialized payload of all loaded libraries.
- See Also:
- valkey.io for details.
-
functionDump
public java.util.concurrent.CompletableFuture<ClusterValue<byte[]>> functionDump(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns the serialized payload of all loaded libraries.- Specified by:
functionDumpin interfaceScriptingAndFunctionsClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The serialized payload of all loaded libraries.
- See Also:
- valkey.io for details.
-
functionRestore
public java.util.concurrent.CompletableFuture<java.lang.String> functionRestore(byte @NonNull [] payload)
Description copied from interface:ScriptingAndFunctionsClusterCommandsRestores libraries from the serialized payload returned byScriptingAndFunctionsClusterCommands.functionDump().
The command will be routed to all primary nodes.- Specified by:
functionRestorein interfaceScriptingAndFunctionsClusterCommands- Parameters:
payload- The serialized data fromScriptingAndFunctionsClusterCommands.functionDump().- Returns:
OK.- See Also:
- valkey.io for details.
-
functionRestore
public java.util.concurrent.CompletableFuture<java.lang.String> functionRestore(byte @NonNull [] payload, @NonNull @NonNull FunctionRestorePolicy policy)Description copied from interface:ScriptingAndFunctionsClusterCommandsRestores libraries from the serialized payload returned byScriptingAndFunctionsClusterCommands.functionDump().
The command will be routed to all primary nodes.- Specified by:
functionRestorein interfaceScriptingAndFunctionsClusterCommands- Parameters:
payload- The serialized data fromScriptingAndFunctionsClusterCommands.functionDump().policy- A policy for handling existing libraries.- Returns:
OK.- See Also:
- valkey.io for details.
-
functionRestore
public java.util.concurrent.CompletableFuture<java.lang.String> functionRestore(byte @NonNull [] payload, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsRestores libraries from the serialized payload returned byScriptingAndFunctionsClusterCommands.functionDump(Route).- Specified by:
functionRestorein interfaceScriptingAndFunctionsClusterCommands- Parameters:
payload- The serialized data fromScriptingAndFunctionsClusterCommands.functionDump().route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
functionRestore
public java.util.concurrent.CompletableFuture<java.lang.String> functionRestore(byte @NonNull [] payload, @NonNull @NonNull FunctionRestorePolicy policy, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsRestores libraries from the serialized payload returned byScriptingAndFunctionsClusterCommands.functionDump(Route).- Specified by:
functionRestorein interfaceScriptingAndFunctionsClusterCommands- Parameters:
payload- The serialized data fromScriptingAndFunctionsClusterCommands.functionDump().policy- A policy for handling existing libraries.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
fcall
public java.util.concurrent.CompletableFuture<java.lang.Object> fcall(@NonNull @NonNull java.lang.String function)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.
The command will be routed to a primary random node.
To route to a replica please refer toScriptingAndFunctionsClusterCommands.fcallReadOnly(String).- Specified by:
fcallin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.- Returns:
- The invoked function's return value.
- See Also:
- valkey.io for details.
-
fcall
public java.util.concurrent.CompletableFuture<java.lang.Object> fcall(@NonNull @NonNull GlideString function)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.
The command will be routed to a primary random node.
To route to a replica please refer toScriptingAndFunctionsClusterCommands.fcallReadOnly(String).- Specified by:
fcallin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.- Returns:
- The invoked function's return value.
- See Also:
- valkey.io for details.
-
fcall
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> fcall(@NonNull @NonNull java.lang.String function, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.- Specified by:
fcallin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The invoked function's return value wrapped by a
ClusterValue. - See Also:
- valkey.io for details.
-
fcall
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> fcall(@NonNull @NonNull GlideString function, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.- Specified by:
fcallin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The invoked function's return value wrapped by a
ClusterValue. - See Also:
- valkey.io for details.
-
fcall
public java.util.concurrent.CompletableFuture<java.lang.Object> fcall(@NonNull @NonNull java.lang.String function, @NonNull @NonNull java.lang.String[] arguments)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.
The command will be routed to a random primary node.
To route to a replica please refer toScriptingAndFunctionsClusterCommands.fcallReadOnly(String, String[]).- Specified by:
fcallin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.arguments- Anarrayoffunctionarguments.argumentsshould not represent names of keys.- Returns:
- The invoked function's return value.
- See Also:
- valkey.io for details.
-
fcall
public java.util.concurrent.CompletableFuture<java.lang.Object> fcall(@NonNull @NonNull GlideString function, @NonNull @NonNull GlideString[] arguments)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.
The command will be routed to a random primary node.
To route to a replica please refer toScriptingAndFunctionsClusterCommands.fcallReadOnly(String, String[]).- Specified by:
fcallin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.arguments- Anarrayoffunctionarguments.argumentsshould not represent names of keys.- Returns:
- The invoked function's return value.
- See Also:
- valkey.io for details.
-
fcall
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> fcall(@NonNull @NonNull java.lang.String function, @NonNull @NonNull java.lang.String[] arguments, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.- Specified by:
fcallin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.arguments- Anarrayoffunctionarguments.argumentsshould not represent names of keys.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The invoked function's return value wrapped by a
ClusterValue. - See Also:
- valkey.io for details.
-
fcall
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> fcall(@NonNull @NonNull GlideString function, @NonNull @NonNull GlideString[] arguments, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.- Specified by:
fcallin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.arguments- Anarrayoffunctionarguments.argumentsshould not represent names of keys.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The invoked function's return value wrapped by a
ClusterValue. - See Also:
- valkey.io for details.
-
fcallReadOnly
public java.util.concurrent.CompletableFuture<java.lang.Object> fcallReadOnly(@NonNull @NonNull java.lang.String function)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded read-only function.
The command is routed to a random node depending on the client'sReadFromstrategy.- Specified by:
fcallReadOnlyin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.- Returns:
- The invoked function's return value.
- See Also:
- valkey.io for details.
-
fcallReadOnly
public java.util.concurrent.CompletableFuture<java.lang.Object> fcallReadOnly(@NonNull @NonNull GlideString function)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded read-only function.
The command is routed to a random node depending on the client'sReadFromstrategy.- Specified by:
fcallReadOnlyin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.- Returns:
- The invoked function's return value.
- See Also:
- valkey.io for details.
-
fcallReadOnly
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> fcallReadOnly(@NonNull @NonNull java.lang.String function, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded read-only function.- Specified by:
fcallReadOnlyin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The invoked function's return value wrapped by a
ClusterValue. - See Also:
- valkey.io for details.
-
fcallReadOnly
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> fcallReadOnly(@NonNull @NonNull GlideString function, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded read-only function.- Specified by:
fcallReadOnlyin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The invoked function's return value wrapped by a
ClusterValue. - See Also:
- valkey.io for details.
-
fcallReadOnly
public java.util.concurrent.CompletableFuture<java.lang.Object> fcallReadOnly(@NonNull @NonNull java.lang.String function, @NonNull @NonNull java.lang.String[] arguments)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.
The command is routed to a random node depending on the client'sReadFromstrategy.- Specified by:
fcallReadOnlyin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.arguments- Anarrayoffunctionarguments.argumentsshould not represent names of keys.- Returns:
- The invoked function's return value.
- See Also:
- valkey.io for details.
-
fcallReadOnly
public java.util.concurrent.CompletableFuture<java.lang.Object> fcallReadOnly(@NonNull @NonNull GlideString function, @NonNull @NonNull GlideString[] arguments)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded function.
The command is routed to a random node depending on the client'sReadFromstrategy.- Specified by:
fcallReadOnlyin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.arguments- Anarrayoffunctionarguments.argumentsshould not represent names of keys.- Returns:
- The invoked function's return value.
- See Also:
- valkey.io for details.
-
fcallReadOnly
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> fcallReadOnly(@NonNull @NonNull java.lang.String function, @NonNull @NonNull java.lang.String[] arguments, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded read-only function.- Specified by:
fcallReadOnlyin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.arguments- Anarrayoffunctionarguments.argumentsshould not represent names of keys.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The invoked function's return value wrapped by a
ClusterValue. - See Also:
- valkey.io for details.
-
fcallReadOnly
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object>> fcallReadOnly(@NonNull @NonNull GlideString function, @NonNull @NonNull GlideString[] arguments, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a previously loaded read-only function.- Specified by:
fcallReadOnlyin interfaceScriptingAndFunctionsClusterCommands- Parameters:
function- The function name.arguments- Anarrayoffunctionarguments.argumentsshould not represent names of keys.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The invoked function's return value wrapped by a
ClusterValue. - See Also:
- valkey.io for details.
-
functionKill
public java.util.concurrent.CompletableFuture<java.lang.String> functionKill()
Description copied from interface:ScriptingAndFunctionsClusterCommandsKills a function that is currently executing.
FUNCTION KILLterminates read-only functions only.
The command will be routed to all nodes.- Specified by:
functionKillin interfaceScriptingAndFunctionsClusterCommands- Returns:
OKif function is terminated. Otherwise, throws an error.- See Also:
- valkey.io for details.
-
functionKill
public java.util.concurrent.CompletableFuture<java.lang.String> functionKill(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsKills a function that is currently executing.
FUNCTION KILLterminates read-only functions only.- Specified by:
functionKillin interfaceScriptingAndFunctionsClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OKif function is terminated. Otherwise, throws an error.- See Also:
- valkey.io for details.
-
invokeScript
public java.util.concurrent.CompletableFuture<java.lang.Object> invokeScript(@NonNull @NonNull Script script, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a Lua script.
This method simplifies the process of invoking scripts on the server by using an object that represents a Lua script. The script loading and execution will all be handled internally. If the script has not already been loaded, it will be loaded automatically using theSCRIPT LOADcommand. After that, it will be invoked using theEVALSHAcommand.- Specified by:
invokeScriptin interfaceScriptingAndFunctionsClusterCommands- Parameters:
script- The Lua script to execute.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A value that depends on the script that was executed.
- See Also:
- SCRIPT LOAD and EVALSHA for details.
-
invokeScript
public java.util.concurrent.CompletableFuture<java.lang.Object> invokeScript(@NonNull @NonNull Script script, @NonNull @NonNull ScriptArgOptions options, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a Lua script with its keys and arguments.
This method simplifies the process of invoking scripts on the server by using an object that represents a Lua script. The script loading, argument preparation, and execution will all be handled internally. If the script has not already been loaded, it will be loaded automatically using theSCRIPT LOADcommand. After that, it will be invoked using theEVALSHAcommand.- Specified by:
invokeScriptin interfaceScriptingAndFunctionsClusterCommands- Parameters:
script- The Lua script to execute.options- The script option that contains the non-key arguments for the script.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A value that depends on the script that was executed.
- See Also:
- SCRIPT LOAD and EVALSHA for details.
-
invokeScript
public java.util.concurrent.CompletableFuture<java.lang.Object> invokeScript(@NonNull @NonNull Script script, @NonNull @NonNull ScriptArgOptionsGlideString options, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsInvokes a Lua script with its keys and arguments.
This method simplifies the process of invoking scripts on the server by using an object that represents a Lua script. The script loading, argument preparation, and execution will all be handled internally. If the script has not already been loaded, it will be loaded automatically using theSCRIPT LOADcommand. After that, it will be invoked using theEVALSHAcommand.- Specified by:
invokeScriptin interfaceScriptingAndFunctionsClusterCommands- Parameters:
script- The Lua script to execute.options- The script option that contains the non-key arguments for the script.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A value that depends on the script that was executed.
- See Also:
- SCRIPT LOAD and EVALSHA for details.
-
scriptExists
public java.util.concurrent.CompletableFuture<java.lang.Boolean[]> scriptExists(@NonNull @NonNull java.lang.String[] sha1s)Description copied from interface:ScriptingAndFunctionsClusterCommandsChecks existence of scripts in the script cache by their SHA1 digest.
The command will be routed to all primary nodes.- Specified by:
scriptExistsin interfaceScriptingAndFunctionsClusterCommands- Overrides:
scriptExistsin classBaseClient- Parameters:
sha1s- SHA1 digests of Lua scripts to be checked.- Returns:
- An array of
booleanvalues indicating the existence of each script. - See Also:
- SCRIPT EXISTS for details.
-
scriptExists
public java.util.concurrent.CompletableFuture<java.lang.Boolean[]> scriptExists(@NonNull @NonNull GlideString[] sha1s)Description copied from interface:ScriptingAndFunctionsClusterCommandsChecks existence of scripts in the script cache by their SHA1 digest.
The command will be routed to all primary nodes.- Specified by:
scriptExistsin interfaceScriptingAndFunctionsClusterCommands- Overrides:
scriptExistsin classBaseClient- Parameters:
sha1s- SHA1 digests of Lua scripts to be checked.- Returns:
- An array of
booleanvalues indicating the existence of each script. - See Also:
- SCRIPT EXISTS for details.
-
scriptExists
public java.util.concurrent.CompletableFuture<java.lang.Boolean[]> scriptExists(@NonNull @NonNull java.lang.String[] sha1s, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsChecks existence of scripts in the script cache by their SHA1 digest.- Specified by:
scriptExistsin interfaceScriptingAndFunctionsClusterCommands- Parameters:
sha1s- SHA1 digests of Lua scripts to be checked.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- An array of
booleanvalues indicating the existence of each script. - See Also:
- SCRIPT EXISTS for details.
-
scriptExists
public java.util.concurrent.CompletableFuture<java.lang.Boolean[]> scriptExists(@NonNull @NonNull GlideString[] sha1s, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsChecks existence of scripts in the script cache by their SHA1 digest.- Specified by:
scriptExistsin interfaceScriptingAndFunctionsClusterCommands- Parameters:
sha1s- SHA1 digests of Lua scripts to be checked.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- An array of
booleanvalues indicating the existence of each script. - See Also:
- SCRIPT EXISTS for details.
-
scriptFlush
public java.util.concurrent.CompletableFuture<java.lang.String> scriptFlush()
Description copied from interface:ScriptingAndFunctionsClusterCommandsFlushes the Lua scripts cache.
The command will be routed to all nodes.- Specified by:
scriptFlushin interfaceScriptingAndFunctionsClusterCommands- Overrides:
scriptFlushin classBaseClient- Returns:
- A simple "OK" response.
- See Also:
- SCRIPT FLUSH for details.
-
scriptFlush
public java.util.concurrent.CompletableFuture<java.lang.String> scriptFlush(@NonNull @NonNull FlushMode flushMode)Description copied from interface:ScriptingAndFunctionsClusterCommandsFlushes the Lua scripts cache.
The command will be routed to all nodes.- Specified by:
scriptFlushin interfaceScriptingAndFunctionsClusterCommands- Overrides:
scriptFlushin classBaseClient- Parameters:
flushMode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.- Returns:
- A simple "OK" response.
- See Also:
- SCRIPT FLUSH for details.
-
scriptFlush
public java.util.concurrent.CompletableFuture<java.lang.String> scriptFlush(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsFlushes the Lua scripts cache.- Specified by:
scriptFlushin interfaceScriptingAndFunctionsClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A simple "OK" response.
- See Also:
- SCRIPT flush for details.
-
scriptFlush
public java.util.concurrent.CompletableFuture<java.lang.String> scriptFlush(@NonNull @NonNull FlushMode flushMode, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsFlushes the Lua scripts cache.- Specified by:
scriptFlushin interfaceScriptingAndFunctionsClusterCommands- Parameters:
flushMode- The flushing mode, could be eitherFlushMode.SYNCorFlushMode.ASYNC.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A simple "OK" response.
- See Also:
- SCRIPT flush for details.
-
scriptKill
public java.util.concurrent.CompletableFuture<java.lang.String> scriptKill()
Description copied from interface:ScriptingAndFunctionsClusterCommandsKill the currently executing Lua script, assuming no write operation was yet performed by the script.
The command will be routed to all nodes.- Specified by:
scriptKillin interfaceScriptingAndFunctionsClusterCommands- Overrides:
scriptKillin classBaseClient- Returns:
- A simple "OK" response.
- See Also:
- SCRIPT KILL for details.
-
scriptKill
public java.util.concurrent.CompletableFuture<java.lang.String> scriptKill(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ScriptingAndFunctionsClusterCommandsKills the currently executing Lua script, assuming no write operation was yet performed by the script.- Specified by:
scriptKillin interfaceScriptingAndFunctionsClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A simple "OK" response.
- See Also:
- SCRIPT KILL for details.
-
functionStats
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>>> functionStats()
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the function that's currently running and information about the available execution engines.
The command will be routed to all nodes.- Specified by:
functionStatsin interfaceScriptingAndFunctionsClusterCommands- Returns:
- A
Mapwith two keys:running_scriptwith information about the running script.engineswith information about available engines and their stats.
- See Also:
- valkey.io for details.
-
functionStatsBinary
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<GlideString,java.util.Map<GlideString,java.lang.Object>>>> functionStatsBinary()
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the function that's currently running and information about the available execution engines.
The command will be routed to all nodes.- Specified by:
functionStatsBinaryin interfaceScriptingAndFunctionsClusterCommands- Returns:
- A
Mapwith two keys:running_scriptwith information about the running script.engineswith information about available engines and their stats.
- See Also:
- valkey.io for details.
-
functionStats
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>>> functionStats(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the function that's currently running and information about the available execution engines.- Specified by:
functionStatsin interfaceScriptingAndFunctionsClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
Mapwith two keys:running_scriptwith information about the running script.engineswith information about available engines and their stats.
- See Also:
- valkey.io for details.
-
functionStatsBinary
public java.util.concurrent.CompletableFuture<ClusterValue<java.util.Map<GlideString,java.util.Map<GlideString,java.lang.Object>>>> functionStatsBinary(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ScriptingAndFunctionsClusterCommandsReturns information about the function that's currently running and information about the available execution engines.- Specified by:
functionStatsBinaryin interfaceScriptingAndFunctionsClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
Mapwith two keys:running_scriptwith information about the running script.engineswith information about available engines and their stats.
- See Also:
- valkey.io for details.
-
publish
public java.util.concurrent.CompletableFuture<java.lang.String> publish(@NonNull @NonNull java.lang.String message, @NonNull @NonNull java.lang.String channel, boolean sharded)Description copied from interface:PubSubClusterCommandsPublishes message on pubsub channel.- Specified by:
publishin interfacePubSubClusterCommands- Parameters:
message- The message to publish.channel- The channel to publish the message on.sharded- Indicates that this should be run in sharded mode. Settingshardedtotrueis only applicable with Valkey 7.0+.- Returns:
OK.- See Also:
- valkey.io for details.
-
publish
public java.util.concurrent.CompletableFuture<java.lang.String> publish(@NonNull @NonNull GlideString message, @NonNull @NonNull GlideString channel, boolean sharded)Description copied from interface:PubSubClusterCommandsPublishes message on pubsub channel.- Specified by:
publishin interfacePubSubClusterCommands- Parameters:
message- The message to publish.channel- The channel to publish the message on.sharded- Indicates that this should be run in sharded mode. Settingshardedtotrueis only applicable with Valkey 7.0+.- Returns:
OK.- See Also:
- valkey.io for details.
-
pubsubShardChannels
public java.util.concurrent.CompletableFuture<java.lang.String[]> pubsubShardChannels()
Description copied from interface:PubSubClusterCommandsLists the currently active shard channels.- Specified by:
pubsubShardChannelsin interfacePubSubClusterCommands- Returns:
- An
arrayof all active shard channels. - See Also:
- valkey.io for details.
-
pubsubShardChannelsBinary
public java.util.concurrent.CompletableFuture<GlideString[]> pubsubShardChannelsBinary()
Description copied from interface:PubSubClusterCommandsLists the currently active shard channels.- Specified by:
pubsubShardChannelsBinaryin interfacePubSubClusterCommands- Returns:
- An
arrayof all active shard channels. - See Also:
- valkey.io for details.
-
pubsubShardChannels
public java.util.concurrent.CompletableFuture<java.lang.String[]> pubsubShardChannels(@NonNull @NonNull java.lang.String pattern)Description copied from interface:PubSubClusterCommandsLists the currently active shard channels.- Specified by:
pubsubShardChannelsin interfacePubSubClusterCommands- Parameters:
pattern- A glob-style pattern to match active shard channels.- Returns:
- An
arrayof currently active shard channels matching the given pattern. - See Also:
- valkey.io for details.
-
pubsubShardChannels
public java.util.concurrent.CompletableFuture<GlideString[]> pubsubShardChannels(@NonNull @NonNull GlideString pattern)
Description copied from interface:PubSubClusterCommandsLists the currently active shard channels.- Specified by:
pubsubShardChannelsin interfacePubSubClusterCommands- Parameters:
pattern- A glob-style pattern to match active shard channels.- Returns:
- An
arrayof currently active shard channels matching the given pattern. - See Also:
- valkey.io for details.
-
pubsubShardNumSub
public java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,java.lang.Long>> pubsubShardNumSub(@NonNull @NonNull java.lang.String[] channels)Description copied from interface:PubSubClusterCommandsReturns the number of subscribers (exclusive of clients subscribed to patterns) for the specified shard channels. Note that it is valid to call this command without channels. In this case, it will just return an empty map.- Specified by:
pubsubShardNumSubin interfacePubSubClusterCommands- Parameters:
channels- The list of shard channels to query for the number of subscribers.- Returns:
- An
Mapwhere keys are the shard channel names and values are the number of subscribers. - See Also:
- valkey.io for details.
-
pubsubShardNumSub
public java.util.concurrent.CompletableFuture<java.util.Map<GlideString,java.lang.Long>> pubsubShardNumSub(@NonNull @NonNull GlideString[] channels)
Description copied from interface:PubSubClusterCommandsReturns the number of subscribers (exclusive of clients subscribed to patterns) for the specified shard channels. Note that it is valid to call this command without channels. In this case, it will just return an empty map.- Specified by:
pubsubShardNumSubin interfacePubSubClusterCommands- Parameters:
channels- The list of shard channels to query for the number of subscribers.- Returns:
- An
Mapwhere keys are the shard channel names and values are the number of subscribers. - See Also:
- valkey.io for details.
-
unwatch
public java.util.concurrent.CompletableFuture<java.lang.String> unwatch(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:TransactionsClusterCommandsFlushes all the previously watched keys for a transaction. Executing a transaction will automatically flush all previously watched keys.- Specified by:
unwatchin interfaceTransactionsClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OK.- See Also:
- valkey.io for details.
-
unwatch
public java.util.concurrent.CompletableFuture<java.lang.String> unwatch()
Description copied from interface:TransactionsClusterCommandsFlushes all the previously watched keys for a transaction. Executing a transaction will automatically flush all previously watched keys.
The command will be routed to all primary nodes.- Specified by:
unwatchin interfaceTransactionsClusterCommands- Returns:
OK.- See Also:
- valkey.io for details.
-
randomKey
public java.util.concurrent.CompletableFuture<java.lang.String> randomKey(@NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:GenericClusterCommandsReturns a random key.- Specified by:
randomKeyin interfaceGenericClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute, and will return the first successful result.- Returns:
- A random
keyfrom the database. - See Also:
- valkey.io for details.
-
randomKeyBinary
public java.util.concurrent.CompletableFuture<GlideString> randomKeyBinary(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:GenericClusterCommandsReturns a random key.- Specified by:
randomKeyBinaryin interfaceGenericClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute, and will return the first successful result.- Returns:
- A random
keyfrom the database. - See Also:
- valkey.io for details.
-
randomKey
public java.util.concurrent.CompletableFuture<java.lang.String> randomKey()
Description copied from interface:GenericClusterCommandsReturns a random key.
The command will be routed to all primary nodes, and will return the first successful result.- Specified by:
randomKeyin interfaceGenericClusterCommands- Returns:
- A random
keyfrom the database. - See Also:
- valkey.io for details.
-
randomKeyBinary
public java.util.concurrent.CompletableFuture<GlideString> randomKeyBinary()
Description copied from interface:GenericClusterCommandsReturns a random key.
The command will be routed to all primary nodes, and will return the first successful result.- Specified by:
randomKeyBinaryin interfaceGenericClusterCommands- Returns:
- A random
keyfrom the database. - See Also:
- valkey.io for details.
-
keys
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String[]>> keys(java.lang.String pattern)
Description copied from interface:GenericClusterCommandsReturns all keys matchingpattern.
The command will be routed to all primary nodes.- Specified by:
keysin interfaceGenericClusterCommands- Parameters:
pattern- The pattern to match keys against.- Returns:
- A
Mapwhere each key is a node address and the value is an array of keys matching the pattern on that node. - See Also:
- valkey.io for details.
-
keys
public java.util.concurrent.CompletableFuture<ClusterValue<GlideString[]>> keys(GlideString pattern)
Description copied from interface:GenericClusterCommandsReturns all keys matchingpattern.
The command will be routed to all primary nodes.- Specified by:
keysin interfaceGenericClusterCommands- Parameters:
pattern- The pattern to match keys against.- Returns:
- A
Mapwhere each key is a node address and the value is an array of keys matching the pattern on that node. - See Also:
- valkey.io for details.
-
keys
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String[]>> keys(java.lang.String pattern, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:GenericClusterCommandsReturns all keys matchingpattern.- Specified by:
keysin interfaceGenericClusterCommands- Parameters:
pattern- The pattern to match keys against.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
Stringarray of keys matching the pattern when routed to a single node, or aMapwhere each key is a node address and the value is an array of keys when routed to multiple nodes. - See Also:
- valkey.io for details.
-
keys
public java.util.concurrent.CompletableFuture<ClusterValue<GlideString[]>> keys(GlideString pattern, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:GenericClusterCommandsReturns all keys matchingpattern.- Specified by:
keysin interfaceGenericClusterCommands- Parameters:
pattern- The pattern to match keys against.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- A
GlideStringarray of keys matching the pattern when routed to a single node, or aMapwhere each key is a node address and the value is an array of keys when routed to multiple nodes. - See Also:
- valkey.io for details.
-
wait
public java.util.concurrent.CompletableFuture<java.lang.Long> wait(long numreplicas, long timeout)Description copied from interface:GenericBaseCommandsBlocks the current client until all the previous write commands are successfully transferred and acknowledged by at leastnumreplicasof replicas. Iftimeoutis reached, the command returns even if the specified number of replicas were not yet reached.- Specified by:
waitin interfaceGenericBaseCommands- Overrides:
waitin classBaseClient- Parameters:
numreplicas- The number of replicas to reach.timeout- The timeout value specified in milliseconds. A value of0will block indefinitely.- Returns:
- The number of replicas reached by all the writes performed in the context of the current connection.
-
waitaof
public java.util.concurrent.CompletableFuture<java.lang.Long[]> waitaof(long numlocal, long numreplicas, long timeout, @NonNull @NonNull RequestRoutingConfiguration.Route route)Description copied from interface:ServerManagementClusterCommandsBlocks the current client until all previous write commands are successfully transferred and acknowledged by at leastnumlocalandnumreplicasof replicas. Iftimeoutis reached, the command returns even if the specified number of replicas were not yet reached.- Specified by:
waitaofin interfaceServerManagementClusterCommands- Parameters:
numlocal- The number of local replicas to reach.numreplicas- The number of replicas to reach.timeout- The timeout value specified in milliseconds. A value of0will block indefinitely.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- An
arrayof twoLongvalues: the number of local replicas reached and the number of replicas reached. - See Also:
- valkey.io for details.
-
scan
public java.util.concurrent.CompletableFuture<java.lang.Object[]> scan(ClusterScanCursor cursor)
Description copied from interface:GenericClusterCommandsIncrementally iterates over the keys in the Cluster.This command is similar to the
SCANcommand, but it is designed to work in a Cluster environment. The main difference is that this command uses aClusterScanCursorobject to manage iterations. For more information about the Cluster Scan implementation, see Cluster Scan.As with the
SCANcommand, this command is a cursor-based iterator. This means that at every call of the command, the server returns an updated cursor (ClusterScanCursor) that the user needs to re-send as thecursorargument in the next call. The iteration terminates when the returned cursorClusterScanCursor.isFinished()returnstrue.This method guarantees that all keyslots available when the first SCAN is called will be scanned before the cursor is finished. Any keys added after the initial scan request is made are not guaranteed to be scanned.
Note that the same key may be returned in multiple scan iterations.
How to use the
ClusterScanCursor:
For each iteration, the previous scanClusterScanCursorobject should be used to continue theSCANby passing it in thecursorargument. Using the same cursor object for multiple iterations may result in the same keys returned or unexpected behavior.When the cursor is no longer needed, call
ClusterScanCursor.releaseCursorHandle()to immediately free resources tied to the cursor. Note that this makes the cursor unusable in subsequent calls toSCAN.- Specified by:
scanin interfaceGenericClusterCommands- Parameters:
cursor- TheClusterScanCursorobject that wraps the scan state. To start a new scan, create a new empty ClusterScanCursor usingClusterScanCursor.initialCursor().- Returns:
- An
Arraywith two elements. The first element is always theClusterScanCursorfor the next iteration of results. To see if there is more data on the given cursor, callClusterScanCursor.isFinished(). To release resources for the current cursor immediately, callClusterScanCursor.releaseCursorHandle()after using the cursor in a call to this method. The cursor cannot be used in a scan again afterClusterScanCursor.releaseCursorHandle()has been called. The second element is anArrayofStringelements each representing a key. - See Also:
- valkey.io for details.
-
scanBinary
public java.util.concurrent.CompletableFuture<java.lang.Object[]> scanBinary(ClusterScanCursor cursor)
Description copied from interface:GenericClusterCommandsIncrementally iterates over the keys in the Cluster.This command is similar to the
SCANcommand, but it is designed to work in a Cluster environment. The main difference is that this command uses aClusterScanCursorobject to manage iterations. For more information about the Cluster Scan implementation, see Cluster Scan.As with the
SCANcommand, this command is a cursor-based iterator. This means that at every call of the command, the server returns an updated cursor (ClusterScanCursor) that the user needs to re-send as thecursorargument in the next call. The iteration terminates when the returned cursorClusterScanCursor.isFinished()returnstrue.This method guarantees that all keyslots available when the first SCAN is called will be scanned before the cursor is finished. Any keys added after the initial scan request is made are not guaranteed to be scanned.
Note that the same key may be returned in multiple scan iterations.
How to use the
ClusterScanCursor:
For each iteration, the previous scanClusterScanCursorobject should be used to continue theSCANby passing it in thecursorargument. Using the same cursor object for multiple iterations may result in the same keys returned or unexpected behavior.When the cursor is no longer needed, call
ClusterScanCursor.releaseCursorHandle()to immediately free resources tied to the cursor. Note that this makes the cursor unusable in subsequent calls toSCAN.- Specified by:
scanBinaryin interfaceGenericClusterCommands- Parameters:
cursor- TheClusterScanCursorobject that wraps the scan state. To start a new scan, create a new empty ClusterScanCursor usingClusterScanCursor.initialCursor().- Returns:
- An
Arraywith two elements. The first element is always theClusterScanCursorfor the next iteration of results. To see if there is more data on the given cursor, callClusterScanCursor.isFinished(). To release resources for the current cursor immediately, callClusterScanCursor.releaseCursorHandle()after using the cursor in a call to this method. The cursor cannot be used in a scan again afterClusterScanCursor.releaseCursorHandle()has been called. The second element is anArrayofGlideStringelements each representing a key. - See Also:
- valkey.io for details.
-
scan
public java.util.concurrent.CompletableFuture<java.lang.Object[]> scan(ClusterScanCursor cursor, ScanOptions options)
Description copied from interface:GenericClusterCommandsIncrementally iterates over the keys in the Cluster.This command is similar to the
SCANcommand, but it is designed to work in a Cluster environment. The main difference is that this command uses aClusterScanCursorobject to manage iterations. For more information about the Cluster Scan implementation, see Cluster Scan.As with the
SCANcommand, this command is a cursor-based iterator. This means that at every call of the command, the server returns an updated cursor (ClusterScanCursor) that the user needs to re-send as thecursorargument in the next call. The iteration terminates when the returned cursorClusterScanCursor.isFinished()returnstrue.This method guarantees that all keyslots available when the first SCAN is called will be scanned before the cursor is finished. Any keys added after the initial scan request is made are not guaranteed to be scanned.
Note that the same key may be returned in multiple scan iterations.
How to use the
ClusterScanCursor:
For each iteration, the previous scanClusterScanCursorobject should be used to continue theSCANby passing it in thecursorargument. Using the same cursor object for multiple iterations may result in the same keys returned or unexpected behavior.When the cursor is no longer needed, call
ClusterScanCursor.releaseCursorHandle()to immediately free resources tied to the cursor. Note that this makes the cursor unusable in subsequent calls toSCAN.- Specified by:
scanin interfaceGenericClusterCommands- Parameters:
cursor- TheClusterScanCursorobject that wraps the scan state. To start a new scan, create a new empty ClusterScanCursor usingClusterScanCursor.initialCursor().options- TheScanOptions.- Returns:
- An
Arraywith two elements. The first element is always theClusterScanCursorfor the next iteration of results. To see if there is more data on the given cursor, callClusterScanCursor.isFinished(). To release resources for the current cursor immediately, callClusterScanCursor.releaseCursorHandle()after using the cursor in a call to this method. The cursor cannot be used in a scan again afterClusterScanCursor.releaseCursorHandle()has been called. The second element is anArrayofStringelements each representing a key. - See Also:
- valkey.io for details.
-
scanBinary
public java.util.concurrent.CompletableFuture<java.lang.Object[]> scanBinary(ClusterScanCursor cursor, ScanOptions options)
Description copied from interface:GenericClusterCommandsIncrementally iterates over the keys in the Cluster.This command is similar to the
SCANcommand, but it is designed to work in a Cluster environment. The main difference is that this command uses aClusterScanCursorobject to manage iterations. For more information about the Cluster Scan implementation, see Cluster Scan.As with the
SCANcommand, this command is a cursor-based iterator. This means that at every call of the command, the server returns an updated cursor (ClusterScanCursor) that the user needs to re-send as thecursorargument in the next call. The iteration terminates when the returned cursorClusterScanCursor.isFinished()returnstrue.This method guarantees that all keyslots available when the first SCAN is called will be scanned before the cursor is finished. Any keys added after the initial scan request is made are not guaranteed to be scanned.
Note that the same key may be returned in multiple scan iterations.
How to use the
ClusterScanCursor:
For each iteration, the previous scanClusterScanCursorobject should be used to continue theSCANby passing it in thecursorargument. Using the same cursor object for multiple iterations may result in the same keys returned or unexpected behavior.When the cursor is no longer needed, call
ClusterScanCursor.releaseCursorHandle()to immediately free resources tied to the cursor. Note that this makes the cursor unusable in subsequent calls toSCAN.- Specified by:
scanBinaryin interfaceGenericClusterCommands- Parameters:
cursor- TheClusterScanCursorobject that wraps the scan state. To start a new scan, create a new empty ClusterScanCursor usingClusterScanCursor.initialCursor().options- TheScanOptions.- Returns:
- An
Arraywith two elements. The first element is always theClusterScanCursorfor the next iteration of results. To see if there is more data on the given cursor, callClusterScanCursor.isFinished(). To release resources for the current cursor immediately, callClusterScanCursor.releaseCursorHandle()after using the cursor in a call to this method. The cursor cannot be used in a scan again afterClusterScanCursor.releaseCursorHandle()has been called. The second element is anArrayofGlideStringelements each representing a key. - See Also:
- valkey.io for details.
-
ssubscribeLazy
public java.util.concurrent.CompletableFuture<java.lang.Void> ssubscribeLazy(java.util.Set<java.lang.String> channels)
Subscribes the client to the specified sharded channels and doesn't wait for confirmation.Sharded pubsub (available in Redis 7.0+) allows messages to be published to specific cluster shards, reducing overhead compared to cluster-wide pubsub.
- Specified by:
ssubscribeLazyin interfacePubSubClusterCommands- Parameters:
channels- A set of sharded channel names to subscribe to- Returns:
- A
CompletableFuturethat completes when the subscription request is processed - See Also:
- valkey.io for details
- Example:
client.ssubscribe(Set.of("shard-news", "shard-updates")).get();
-
ssubscribe
public java.util.concurrent.CompletableFuture<java.lang.Void> ssubscribe(java.util.Set<java.lang.String> channels, int timeoutMs)Subscribes the client to the specified sharded channels with a timeout.- Specified by:
ssubscribein interfacePubSubClusterCommands- Parameters:
channels- A set of sharded channel names to subscribe totimeoutMs- Maximum time in milliseconds to wait for subscription confirmation- Returns:
- A
CompletableFuturethat completes when the subscription is confirmed or times out - See Also:
- valkey.io for details
- Example:
client.ssubscribe(Set.of("shard-news", "shard-updates"), 5000).get();
-
sunsubscribeLazy
public java.util.concurrent.CompletableFuture<java.lang.Void> sunsubscribeLazy()
Unsubscribes the client from all currently subscribed sharded channels.This command updates the client's internal desired subscription state without waiting for server confirmation. It returns immediately after updating the local state. The client will attempt to unsubscribe asynchronously in the background.
Note: Use
getSubscriptions()to verify the actual server-side subscription state.- Specified by:
sunsubscribeLazyin interfacePubSubClusterCommands- Returns:
- A
CompletableFuturethat completes when the unsubscription request is processed - See Also:
- valkey.io for details
- Example:
client.sunsubscribeLazy().get();
-
sunsubscribeLazy
public java.util.concurrent.CompletableFuture<java.lang.Void> sunsubscribeLazy(java.util.Set<java.lang.String> channels)
Unsubscribes the client from the specified sharded channels.This command updates the client's internal desired subscription state without waiting for server confirmation. It returns immediately after updating the local state. The client will attempt to unsubscribe asynchronously in the background.
Note: Use
getSubscriptions()to verify the actual server-side subscription state.- Specified by:
sunsubscribeLazyin interfacePubSubClusterCommands- Parameters:
channels- A set of sharded channel names to unsubscribe from- Returns:
- A
CompletableFuturethat completes when the unsubscription request is processed - See Also:
- valkey.io for details
- Example:
client.sunsubscribeLazy(Set.of("shard-news", "shard-updates")).get();
-
sunsubscribe
public java.util.concurrent.CompletableFuture<java.lang.Void> sunsubscribe(java.util.Set<java.lang.String> channels, int timeoutMs)Unsubscribes the client from the specified sharded channels with a timeout.- Specified by:
sunsubscribein interfacePubSubClusterCommands- Parameters:
channels- A set of sharded channel names to unsubscribe fromtimeoutMs- Maximum time in milliseconds to wait for unsubscription confirmation- Returns:
- A
CompletableFuturethat completes when the unsubscription is confirmed or times out - See Also:
- valkey.io for details
- Example:
client.sunsubscribe(Set.of("shard-news", "shard-updates"), 5000).get();
-
sunsubscribe
public java.util.concurrent.CompletableFuture<java.lang.Void> sunsubscribe(int timeoutMs)
Unsubscribes the client from all currently subscribed sharded channels with a timeout.- Specified by:
sunsubscribein interfacePubSubClusterCommands- Parameters:
timeoutMs- Maximum time in milliseconds to wait for unsubscription confirmation- Returns:
- A
CompletableFuturethat completes when the unsubscription is confirmed or times out - See Also:
- valkey.io for details
- Example:
client.sunsubscribe(5000).get();
-
getSubscriptions
public java.util.concurrent.CompletableFuture<PubSubState<ClusterSubscriptionConfiguration.PubSubClusterChannelMode>> getSubscriptions()
Gets the current subscription state for this cluster client.Returns the desired and actual subscription states, which may differ if subscriptions are being reconciled after a connection loss.
The returned
PubSubStatecontains:- Desired subscriptions: The channels/patterns the client intends to be subscribed to
- Actual subscriptions: The channels/patterns currently subscribed on the server
- Returns:
- A
CompletableFuturethat completes with aPubSubStatecontaining: - See Also:
- valkey.io for PUBSUB CHANNELS, valkey.io for PUBSUB NUMPAT, valkey.io for PUBSUB SHARDCHANNELS
- Example:
// Get current subscription state PubSubState<PubSubClusterChannelMode> state = client.getSubscriptions().get(); // Check desired subscriptions Set<String> desiredChannels = state.getDesiredSubscriptions() .getOrDefault(PubSubClusterChannelMode.EXACT, Set.of()); Set<String> desiredSharded = state.getDesiredSubscriptions() .getOrDefault(PubSubClusterChannelMode.SHARDED, Set.of()); // Check actual subscriptions Set<String> actualChannels = state.getActualSubscriptions() .getOrDefault(PubSubClusterChannelMode.EXACT, Set.of());
-
clusterMeet
public java.util.concurrent.CompletableFuture<java.lang.String> clusterMeet(@NonNull @NonNull java.lang.String host, long port)Description copied from interface:NodeManagementCommandsAdds a new node to the cluster. This command is used to connect a new node to the cluster by specifying the IP address and port of the node to add.
The command will be routed to a random node in the cluster.- Specified by:
clusterMeetin interfaceNodeManagementCommands- Parameters:
host- The IP address or hostname of the node to add to the cluster.port- The port number of the node to add to the cluster.- Returns:
OKif the node was successfully added to the cluster.- See Also:
- valkey.io for details.
-
clusterMeet
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> clusterMeet(@NonNull @NonNull java.lang.String host, long port, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:NodeManagementCommandsAdds a new node to the cluster. This command is used to connect a new node to the cluster by specifying the IP address and port of the node to add.- Specified by:
clusterMeetin interfaceNodeManagementCommands- Parameters:
host- The IP address or hostname of the node to add to the cluster.port- The port number of the node to add to the cluster.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OKif the node was successfully added to the cluster. When specifying arouteother than a single node, it returns aMap<String, String>with each address as the key and its corresponding result.- See Also:
- valkey.io for details.
-
clusterForget
public java.util.concurrent.CompletableFuture<java.lang.String> clusterForget(@NonNull @NonNull java.lang.String nodeId)Description copied from interface:NodeManagementCommandsRemoves a node from the cluster. The node is specified by its ID. This command must be sent to a node that is not the one being removed.
The command will be routed to a random node in the cluster.Warning: This is a permanent operation. Once a node is forgotten, it must be re-added to the cluster using
NodeManagementCommands.clusterMeet(String, long)if you wish to include it again.- Specified by:
clusterForgetin interfaceNodeManagementCommands- Parameters:
nodeId- The ID of the node to remove from the cluster. The node ID is a 40-character hexadecimal string.- Returns:
OKif the node was successfully removed from the cluster.- See Also:
- valkey.io for details.
-
clusterReplicate
public java.util.concurrent.CompletableFuture<java.lang.String> clusterReplicate(@NonNull @NonNull java.lang.String nodeId)Description copied from interface:NodeManagementCommandsConfigures the current node to replicate data from a primary node identified bynodeId. This command reconfigures a node to become a replica of the specified primary.
The command must be sent to the node that should become the replica.- Specified by:
clusterReplicatein interfaceNodeManagementCommands- Parameters:
nodeId- The ID of the primary node to replicate. The node ID is a 40-character hexadecimal string.- Returns:
OKif the node was successfully configured as a replica.- See Also:
- valkey.io for details.
-
clusterReplicas
public java.util.concurrent.CompletableFuture<java.lang.String[]> clusterReplicas(@NonNull @NonNull java.lang.String nodeId)Description copied from interface:NodeManagementCommandsReturns a list of replicas (slaves) for the specified primary node. Each line in the output represents a replica and contains information similar to theCLUSTER NODESformat.
The command will be routed to a random node in the cluster.- Specified by:
clusterReplicasin interfaceNodeManagementCommands- Parameters:
nodeId- The ID of the primary node to get replicas for. The node ID is a 40-character hexadecimal string.- Returns:
- An array of strings, where each string contains information about a replica node.
- See Also:
- valkey.io for details.
-
clusterReplicas
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String[]>> clusterReplicas(@NonNull @NonNull java.lang.String nodeId, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:NodeManagementCommandsReturns a list of replicas (slaves) for the specified primary node. Each line in the output represents a replica and contains information similar to theCLUSTER NODESformat.- Specified by:
clusterReplicasin interfaceNodeManagementCommands- Parameters:
nodeId- The ID of the primary node to get replicas for. The node ID is a 40-character hexadecimal string.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- An array of strings, where each string contains information about a replica node. When
specifying a
routeother than a single node, it returns aMap<String, String[]>with each address as the key and its corresponding result. - See Also:
- valkey.io for details.
-
clusterCountFailureReports
public java.util.concurrent.CompletableFuture<java.lang.Long> clusterCountFailureReports(@NonNull @NonNull java.lang.String nodeId)Description copied from interface:NodeManagementCommandsReturns the number of failure reports for the specified node. Failure reports are the way nodes in the cluster signal that another node might be in a failure state.
The command will be routed to a random node in the cluster.- Specified by:
clusterCountFailureReportsin interfaceNodeManagementCommands- Parameters:
nodeId- The ID of the node to get failure report count for. The node ID is a 40-character hexadecimal string.- Returns:
- The number of active failure reports for the specified node.
- See Also:
- valkey.io for details.
-
clusterCountFailureReports
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Long>> clusterCountFailureReports(@NonNull @NonNull java.lang.String nodeId, @NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:NodeManagementCommandsReturns the number of failure reports for the specified node. Failure reports are the way nodes in the cluster signal that another node might be in a failure state.- Specified by:
clusterCountFailureReportsin interfaceNodeManagementCommands- Parameters:
nodeId- The ID of the node to get failure report count for. The node ID is a 40-character hexadecimal string.route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- The number of active failure reports for the specified node. When specifying a
routeother than a single node, it returns aMap<String, Long>with each address as the key and its corresponding result. - See Also:
- valkey.io for details.
-
clusterFailover
public java.util.concurrent.CompletableFuture<java.lang.String> clusterFailover()
Description copied from interface:ClusterOperationsCommandsInitiates a manual failover of the primary node to one of its replicas. This command must be sent to a replica node. The replica will attempt to perform a failover, becoming the new primary.
The command must be sent to a replica node.- Specified by:
clusterFailoverin interfaceClusterOperationsCommands- Returns:
OKif the failover was successfully initiated.- See Also:
- valkey.io for details.
-
clusterFailover
public java.util.concurrent.CompletableFuture<java.lang.String> clusterFailover(@NonNull @NonNull ClusterFailoverOptions options)Description copied from interface:ClusterOperationsCommandsInitiates a manual failover of the primary node to one of its replicas with specified options. This command must be sent to a replica node. The replica will attempt to perform a failover, becoming the new primary.- Specified by:
clusterFailoverin interfaceClusterOperationsCommands- Parameters:
options- The failover options specifying the type of failover to perform (FORCE or TAKEOVER).- Returns:
OKif the failover was successfully initiated.- See Also:
- valkey.io for details.
-
clusterSetSlot
public java.util.concurrent.CompletableFuture<java.lang.String> clusterSetSlot(long slot, @NonNull @NonNull ClusterSetSlotOptions options)Description copied from interface:ClusterOperationsCommandsManages the assignment of hash slots to nodes in the cluster. This command is used during cluster reconfiguration to migrate slots between nodes. The specific action depends on the provided options (IMPORTING, MIGRATING, STABLE, or NODE).- Specified by:
clusterSetSlotin interfaceClusterOperationsCommands- Parameters:
slot- The hash slot number to manage (0-16383).options- The options specifying the action to perform on the slot.- Returns:
OKif the slot assignment was successfully updated.- See Also:
- valkey.io for details.
-
clusterBumpEpoch
public java.util.concurrent.CompletableFuture<java.lang.String> clusterBumpEpoch()
Description copied from interface:ClusterOperationsCommandsForces a node to increment its configuration epoch. This is an advanced command that should be used with caution. It is primarily used during cluster reconfiguration scenarios to force epoch increments.- Specified by:
clusterBumpEpochin interfaceClusterOperationsCommands- Returns:
BUMPEDif the epoch was successfully incremented, orSTILLif the current configuration epoch is already the greatest in the cluster.- See Also:
- valkey.io for details.
-
clusterSetConfigEpoch
public java.util.concurrent.CompletableFuture<java.lang.String> clusterSetConfigEpoch(long configEpoch)
Description copied from interface:ClusterOperationsCommandsSets the configuration epoch for a node. This is an advanced command used during cluster reconfiguration. The configuration epoch is a version number for the cluster configuration, and this command allows explicitly setting it.Warning: Misuse of this command can lead to cluster inconsistencies. Use with caution and only during controlled reconfiguration scenarios.
- Specified by:
clusterSetConfigEpochin interfaceClusterOperationsCommands- Parameters:
configEpoch- The configuration epoch value to set.- Returns:
OKif the configuration epoch was successfully set.- See Also:
- valkey.io for details.
-
clusterFlushSlots
public java.util.concurrent.CompletableFuture<java.lang.String> clusterFlushSlots()
Description copied from interface:ClusterOperationsCommandsClears the node's hash slot ownership information. This command removes all slots assigned to the node, effectively clearing its slot assignment cache. This is typically used during cluster reconfiguration or resharding.Warning: This is a disruptive operation that clears the node's slot assignments. The node will no longer claim ownership of any slots until they are reassigned.
- Specified by:
clusterFlushSlotsin interfaceClusterOperationsCommands- Returns:
OKif the slots were successfully flushed.- See Also:
- valkey.io for details.
-
clusterReset
public java.util.concurrent.CompletableFuture<java.lang.String> clusterReset()
Description copied from interface:ClusterOperationsCommandsResets a cluster node, clearing its cluster configuration and state. By default, performs a soft reset.
The command must be sent to the node to reset.Warning: This is a destructive operation. A soft reset will clear cluster state but preserve data. Use with caution.
- Specified by:
clusterResetin interfaceClusterOperationsCommands- Returns:
OKif the node was successfully reset.- See Also:
- valkey.io for details.
-
clusterReset
public java.util.concurrent.CompletableFuture<java.lang.String> clusterReset(@NonNull @NonNull ClusterResetOptions options)Description copied from interface:ClusterOperationsCommandsResets a cluster node with specified options, clearing its cluster configuration and state.
The command must be sent to the node to reset.Warning: This is a destructive operation. A soft reset clears cluster state but preserves data, while a hard reset clears both cluster state and all data. Use with extreme caution, especially with HARD option.
- Specified by:
clusterResetin interfaceClusterOperationsCommands- Parameters:
options- The reset options specifying the type of reset (SOFT or HARD).- Returns:
OKif the node was successfully reset.- See Also:
- valkey.io for details.
-
readonly
public java.util.concurrent.CompletableFuture<java.lang.String> readonly()
Description copied from interface:ConnectionControlCommandsEnables read queries for a connection to a cluster replica node. By default, replica nodes in a cluster will redirect read commands to the primary node. This command allows read commands to be executed on the replica node itself.
This command affects only the current connection and must be sent to a replica node.- Specified by:
readonlyin interfaceConnectionControlCommands- Returns:
OKif read-only mode was successfully enabled for this connection.- See Also:
- valkey.io for details.
-
readwrite
public java.util.concurrent.CompletableFuture<java.lang.String> readwrite()
Description copied from interface:ConnectionControlCommandsDisables read queries for a connection to a cluster replica node. This is the default mode. After calling this command, the replica node will redirect read commands to the primary node.
This command affects only the current connection and must be sent to a replica node.- Specified by:
readwritein interfaceConnectionControlCommands- Returns:
OKif read-write mode was successfully restored for this connection.- See Also:
- valkey.io for details.
-
asking
public java.util.concurrent.CompletableFuture<java.lang.String> asking()
Description copied from interface:ConnectionControlCommandsAllows the execution of commands in the context of a slot migration. When a slot is being migrated from one node to another, this command signals that the current connection is aware of the migration and should allow commands targeting the migrating slot to proceed.
This is typically used after receiving an ASK redirection error during slot migration.- Specified by:
askingin interfaceConnectionControlCommands- Returns:
OKif the ASKING flag was successfully set for the next command.- See Also:
- valkey.io for details.
-
clusterSaveConfig
public java.util.concurrent.CompletableFuture<java.lang.String> clusterSaveConfig()
Description copied from interface:ClusterAdminCommandsSaves the cluster configuration to disk. This forces the node to persist its current cluster configuration (including node mappings, slot assignments, etc.) to the cluster configuration file on disk.
The command will be routed to a random node in the cluster.- Specified by:
clusterSaveConfigin interfaceClusterAdminCommands- Returns:
OKif the configuration was successfully saved.- See Also:
- valkey.io for details.
-
clusterSaveConfig
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> clusterSaveConfig(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ClusterAdminCommandsSaves the cluster configuration to disk. This forces the node(s) to persist their current cluster configuration (including node mappings, slot assignments, etc.) to the cluster configuration file on disk.- Specified by:
clusterSaveConfigin interfaceClusterAdminCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
OKif the configuration was successfully saved. When specifying arouteother than a single node, it returns aMap<String, String>with each address as the key and its corresponding result.- See Also:
- valkey.io for details.
-
clusterInfo
public java.util.concurrent.CompletableFuture<java.lang.String> clusterInfo()
Description copied from interface:ClusterManagementClusterCommandsGets information and statistics about the cluster state.
The command will be routed to a random node.- Specified by:
clusterInfoin interfaceClusterManagementClusterCommands- Returns:
- A
Stringcontaining cluster state information with key-value pairs separated by newlines. Key fields include:cluster_state- State of the cluster (ok or fail)cluster_slots_assigned- Number of slots assignedcluster_slots_ok- Number of slots in OK statecluster_slots_pfail- Number of slots in PFAIL statecluster_slots_fail- Number of slots in FAIL statecluster_known_nodes- Total number of known nodescluster_size- Number of primary nodes serving at least one slotcluster_current_epoch- Current cluster epochcluster_my_epoch- Config epoch of the current nodecluster_stats_messages_sent- Number of messages sentcluster_stats_messages_received- Number of messages received
- See Also:
- valkey.io for details.
-
clusterInfo
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> clusterInfo(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ClusterManagementClusterCommandsGets information and statistics about the cluster state.- Specified by:
clusterInfoin interfaceClusterManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- When specifying a single-node route, returns a
Stringcontaining cluster state information. When specifying a multi-node route, returns aMap<String, String>with each node address as the key and its cluster state information as the value. - See Also:
- valkey.io for details.
-
clusterNodes
public java.util.concurrent.CompletableFuture<java.lang.String> clusterNodes()
Description copied from interface:ClusterManagementClusterCommandsGets a list of all nodes in the cluster and their attributes.
The command will be routed to a random node.- Specified by:
clusterNodesin interfaceClusterManagementClusterCommands- Returns:
- A
Stringcontaining information about all nodes in the cluster. Each line represents a node with space-separated fields:node-id- 40-character hex string identifierip:port@cport- Node address (IPv4, IPv6, or hostname). The @cport is the cluster port used for node-to-node communicationflags- Comma-separated list (myself, master, slave, fail?, fail, handshake, noaddr, nofailover, noflags)master-id- Node ID of the master (or "-" if this node is a master)ping-sent- Milliseconds unix time of last ping sent (0 if no ping sent)pong-recv- Milliseconds unix time of last pong receivedconfig-epoch- Config epoch of this nodelink-state- State of the node-to-node link (connected or disconnected)slots- Hash slots served by this node (e.g., 0-5460 or individual slots like 1 2 3)
- See Also:
- valkey.io for details.
-
clusterNodes
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> clusterNodes(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ClusterManagementClusterCommandsGets a list of all nodes in the cluster and their attributes.- Specified by:
clusterNodesin interfaceClusterManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- When specifying a single-node route, returns a
Stringcontaining node information. When specifying a multi-node route, returns aMap<String, String>with each node address as the key and its node listing as the value. - See Also:
- valkey.io for details.
-
clusterShards
public java.util.concurrent.CompletableFuture<java.lang.Object[]> clusterShards()
Description copied from interface:ClusterManagementClusterCommandsReturns details about the shards of the cluster.
The command will be routed to a random node.- Specified by:
clusterShardsin interfaceClusterManagementClusterCommands- Returns:
- An
arrayof maps, where each map represents a shard and contains the following keys:"slots"- An array of slot ranges (each range is a two-element array [start, end])"nodes"- An array of node objects in this shard, each containing:"id"- Node ID (40-character hex string)"endpoint"- Node address (IP and port)"ip"- Node IP address (IPv4 or IPv6)"port"- Node port number"role"- Node role ("master" or "replica")"replication-offset"- Replication offset"health"- Node health status ("online", "failed", "loading")
- See Also:
- valkey.io for details.
-
clusterShards
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[]>> clusterShards(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ClusterManagementClusterCommandsReturns details about the shards of the cluster.- Specified by:
clusterShardsin interfaceClusterManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- When specifying a single-node route, returns an
arrayof shard information maps. When specifying a multi-node route, returns aMap<String, Object[]>with each node address as the key and its shard details array as the value. - See Also:
- valkey.io for details.
-
clusterLinks
public java.util.concurrent.CompletableFuture<java.lang.Object[]> clusterLinks()
Description copied from interface:ClusterManagementClusterCommandsReturns information about the TCP links to and from each node in the cluster.
The command will be routed to a random node.- Specified by:
clusterLinksin interfaceClusterManagementClusterCommands- Returns:
- An
arrayof maps, where each map represents a cluster link and contains the following keys:"direction"- Link direction ("to" or "from")"node"- Node ID (40-character hex string) at the other end of the link"create-time"- Timestamp when the link was created (milliseconds)"events"- Event flags for the link (e.g., "r" for readable, "w" for writable)"send-buffer-allocated"- Allocated size of the send buffer"send-buffer-used"- Size of the send buffer currently in use"recv-buffer-allocated"- Allocated size of the receive buffer"recv-buffer-used"- Size of the receive buffer currently in use
- See Also:
- valkey.io for details.
-
clusterLinks
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.Object[]>> clusterLinks(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ClusterManagementClusterCommandsReturns information about the TCP links to and from each node in the cluster.- Specified by:
clusterLinksin interfaceClusterManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- When specifying a single-node route, returns an
arrayof link information maps. When specifying a multi-node route, returns aMap<String, Object[]>with each node address as the key and its link details array as the value. - See Also:
- valkey.io for details.
-
clusterMyId
public java.util.concurrent.CompletableFuture<java.lang.String> clusterMyId()
Description copied from interface:ClusterManagementClusterCommandsReturns the unique identifier (ID) of the current node.
The command will be routed to a random node.- Specified by:
clusterMyIdin interfaceClusterManagementClusterCommands- Returns:
- A
Stringcontaining the unique 40-character identifier of the node executing the command. This ID remains constant for the lifetime of the node and is used in various cluster commands to reference this specific node. - See Also:
- valkey.io for details.
-
clusterMyId
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> clusterMyId(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ClusterManagementClusterCommandsReturns the unique identifier (ID) of the node(s).- Specified by:
clusterMyIdin interfaceClusterManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- When specifying a single-node route, returns a
Stringcontaining the node ID. When specifying a multi-node route, returns aMap<String, String>with each node address as the key and its node ID as the value. - See Also:
- valkey.io for details.
-
clusterMyShardId
public java.util.concurrent.CompletableFuture<java.lang.String> clusterMyShardId()
Description copied from interface:ClusterManagementClusterCommandsReturns the shard ID of the current node.
The command will be routed to a random node.In Valkey, a shard is a set of nodes that replicate the same data (one primary and zero or more replicas). The shard ID is a unique identifier for this replication group and remains constant even during failovers when the primary role transfers to a replica.
- Specified by:
clusterMyShardIdin interfaceClusterManagementClusterCommands- Returns:
- A
Stringcontaining the unique shard identifier of the current node. All nodes in the same shard (primary and replicas) share the same shard ID. - See Also:
- valkey.io for details.
-
clusterMyShardId
public java.util.concurrent.CompletableFuture<ClusterValue<java.lang.String>> clusterMyShardId(@NonNull @NonNull RequestRoutingConfiguration.Route route)
Description copied from interface:ClusterManagementClusterCommandsReturns the shard ID of the node(s).In Valkey, a shard is a set of nodes that replicate the same data (one primary and zero or more replicas). The shard ID is a unique identifier for this replication group and remains constant even during failovers when the primary role transfers to a replica.
- Specified by:
clusterMyShardIdin interfaceClusterManagementClusterCommands- Parameters:
route- Specifies the routing configuration for the command. The client will route the command to the nodes defined byroute.- Returns:
- When specifying a single-node route, returns a
Stringcontaining the shard ID. When specifying a multi-node route, returns aMap<String, String>with each node address as the key and its shard ID as the value. - See Also:
- valkey.io for details.
-
clusterKeySlot
public java.util.concurrent.CompletableFuture<java.lang.Long> clusterKeySlot(@NonNull @NonNull java.lang.String key)Description copied from interface:ClusterManagementClusterCommandsReturns the hash slot number for the given key.
The command will be routed to a random node.The hash slot determines which node in a cluster is responsible for a given key. Valkey Cluster uses 16384 hash slots (0-16383). Keys are mapped to slots using CRC16 of the key modulo 16384.
- Specified by:
clusterKeySlotin interfaceClusterManagementClusterCommands- Parameters:
key- The key to get the hash slot for.- Returns:
- The hash slot number (0-16383) for the given key.
- See Also:
- valkey.io for details.
-
clusterKeySlot
public java.util.concurrent.CompletableFuture<java.lang.Long> clusterKeySlot(@NonNull @NonNull GlideString key)Description copied from interface:ClusterManagementClusterCommandsReturns the hash slot number for the given binary key.
The command will be routed to a random node.- Specified by:
clusterKeySlotin interfaceClusterManagementClusterCommands- Parameters:
key- The binary key to get the hash slot for.- Returns:
- The hash slot number (0-16383) for the given key.
- See Also:
- valkey.io for details.
-
clusterCountKeysInSlot
public java.util.concurrent.CompletableFuture<java.lang.Long> clusterCountKeysInSlot(long slot)
Description copied from interface:ClusterManagementClusterCommandsReturns the number of keys in the specified hash slot.
The command will be routed to the node responsible for the specified slot.- Specified by:
clusterCountKeysInSlotin interfaceClusterManagementClusterCommands- Parameters:
slot- The hash slot number (0-16383) to count keys in.- Returns:
- The number of keys in the specified slot.
- See Also:
- valkey.io for details.
-
clusterGetKeysInSlot
public java.util.concurrent.CompletableFuture<java.lang.String[]> clusterGetKeysInSlot(long slot, long count)Description copied from interface:ClusterAdminCommandsReturns an array of keys stored in the specified hash slot. This command is useful for inspecting the contents of a slot, particularly during slot migration or resharding operations.
The command will be routed to the node that owns the specified slot.- Specified by:
clusterGetKeysInSlotin interfaceClusterAdminCommands- Specified by:
clusterGetKeysInSlotin interfaceClusterManagementClusterCommands- Parameters:
slot- The hash slot number to query (0-16383).count- The maximum number of keys to return from the slot.- Returns:
- An array of keys stored in the specified slot. The array may contain fewer keys than
countif the slot has fewer keys. - See Also:
- valkey.io for details.
-
clusterGetKeysInSlotBinary
public java.util.concurrent.CompletableFuture<GlideString[]> clusterGetKeysInSlotBinary(long slot, long count)
Description copied from interface:ClusterManagementClusterCommandsReturns an array of binary keys in the specified hash slot.
The command will be routed to the node responsible for the specified slot.- Specified by:
clusterGetKeysInSlotBinaryin interfaceClusterManagementClusterCommands- Parameters:
slot- The hash slot number (0-16383) to retrieve keys from.count- The maximum number of keys to return. Must be positive.- Returns:
- An array of up to
countbinary keys belonging to the specified slot. Returns an empty array if the slot is empty or does not exist. - See Also:
- valkey.io for details.
-
clusterAddSlots
public java.util.concurrent.CompletableFuture<java.lang.String> clusterAddSlots(long @NonNull [] slots)
Description copied from interface:ClusterManagementClusterCommandsAssigns hash slots to the current node.
The command will be routed to the node executing the command.- Specified by:
clusterAddSlotsin interfaceClusterManagementClusterCommands- Parameters:
slots- An array of hash slot numbers (0-16383) to assign to the node. Slots must not already be assigned to any node.- Returns:
"OK"if the slots were successfully assigned.- See Also:
- valkey.io for details.
-
clusterAddSlotsRange
public java.util.concurrent.CompletableFuture<java.lang.String> clusterAddSlotsRange(long[] @NonNull [] slotRanges)
Description copied from interface:ClusterManagementClusterCommandsAssigns hash slot ranges to the current node.
The command will be routed to the node executing the command.This command is more efficient than
ClusterManagementClusterCommands.clusterAddSlots(long[])when assigning multiple contiguous slot ranges, as it uses the CLUSTER ADDSLOTSRANGE command introduced in Valkey 7.0.- Specified by:
clusterAddSlotsRangein interfaceClusterManagementClusterCommands- Parameters:
slotRanges- A 2D array where each sub-array contains two elements: [start_slot, end_slot] representing an inclusive range of slots to assign. All slots must be between 0-16383 and not already assigned.- Returns:
"OK"if the slot ranges were successfully assigned.- See Also:
- valkey.io for details.
-
clusterDelSlots
public java.util.concurrent.CompletableFuture<java.lang.String> clusterDelSlots(long @NonNull [] slots)
Description copied from interface:ClusterManagementClusterCommandsRemoves hash slots from the current node.
The command will be routed to the node executing the command.Once a slot is removed, it becomes unassigned and can be assigned to another node or reassigned to the current node. This is typically used during cluster reconfiguration or before removing a node from the cluster.
- Specified by:
clusterDelSlotsin interfaceClusterManagementClusterCommands- Parameters:
slots- An array of hash slot numbers (0-16383) to remove from the node. Slots must currently be assigned to this node.- Returns:
"OK"if the slots were successfully removed.- See Also:
- valkey.io for details.
-
clusterDelSlotsRange
public java.util.concurrent.CompletableFuture<java.lang.String> clusterDelSlotsRange(long[] @NonNull [] slotRanges)
Description copied from interface:ClusterManagementClusterCommandsRemoves hash slot ranges from the current node.
The command will be routed to the node executing the command.This command is more efficient than
ClusterManagementClusterCommands.clusterDelSlots(long[])when removing multiple contiguous slot ranges, as it uses the CLUSTER DELSLOTSRANGE command introduced in Valkey 7.0.- Specified by:
clusterDelSlotsRangein interfaceClusterManagementClusterCommands- Parameters:
slotRanges- A 2D array where each sub-array contains two elements: [start_slot, end_slot] representing an inclusive range of slots to remove. All slots must be between 0-16383 and currently assigned to this node.- Returns:
"OK"if the slot ranges were successfully removed.- See Also:
- valkey.io for details.
-
-