pub trait ClusterCommands {
Show 27 methods
// Provided methods
fn asking(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
fn cluster_addslots<S>(&mut self, slots: S) -> PreparedCommand<'_, Self, ()>
where Self: Sized,
S: SingleArgOrCollection<u16> { ... }
fn cluster_addslotsrange<S>(
&mut self,
slots: S,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized,
S: KeyValueArgOrCollection<u16, u16> { ... }
fn cluster_bumpepoch(
&mut self,
) -> PreparedCommand<'_, Self, ClusterBumpEpochResult>
where Self: Sized { ... }
fn cluster_count_failure_reports<I>(
&mut self,
node_id: I,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized,
I: Into<CommandArg> { ... }
fn cluster_countkeysinslot(
&mut self,
slot: usize,
) -> PreparedCommand<'_, Self, usize>
where Self: Sized { ... }
fn cluster_delslots<S>(&mut self, slots: S) -> PreparedCommand<'_, Self, ()>
where Self: Sized,
S: SingleArgOrCollection<u16> { ... }
fn cluster_delslotsrange<S>(
&mut self,
slots: S,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized,
S: KeyValueArgOrCollection<u16, u16> { ... }
fn cluster_failover(
&mut self,
option: ClusterFailoverOption,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
fn cluster_flushslots(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
fn cluster_forget<I>(&mut self, node_id: I) -> PreparedCommand<'_, Self, ()>
where Self: Sized,
I: Into<CommandArg> { ... }
fn cluster_getkeysinslot(
&mut self,
slot: u16,
count: usize,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
fn cluster_info(
&mut self,
slot: u16,
count: usize,
) -> PreparedCommand<'_, Self, ClusterInfo>
where Self: Sized { ... }
fn cluster_keyslot<K>(&mut self, key: K) -> PreparedCommand<'_, Self, u16>
where Self: Sized,
K: Into<CommandArg> { ... }
fn cluster_links<I>(&mut self) -> PreparedCommand<'_, Self, Vec<I>>
where Self: Sized,
I: FromSingleValueArray<ClusterLinkInfo> { ... }
fn cluster_meet<IP>(
&mut self,
ip: IP,
port: u16,
cluster_bus_port: Option<u16>,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized,
IP: Into<CommandArg> { ... }
fn cluster_myid<N>(&mut self) -> PreparedCommand<'_, Self, N>
where Self: Sized,
N: FromValue { ... }
fn cluster_nodes<R>(&mut self) -> PreparedCommand<'_, Self, R>
where Self: Sized,
R: FromValue { ... }
fn cluster_replicas<I, R>(
&mut self,
node_id: I,
) -> PreparedCommand<'_, Self, R>
where Self: Sized,
I: Into<CommandArg>,
R: FromValue { ... }
fn cluster_replicate<I>(
&mut self,
node_id: I,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized,
I: Into<CommandArg> { ... }
fn cluster_reset(
&mut self,
reset_type: ClusterResetType,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
fn cluster_saveconfig(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
fn cluster_set_config_epoch(
&mut self,
config_epoch: u64,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
fn cluster_setslot(
&mut self,
slot: u16,
subcommand: ClusterSetSlotSubCommand,
) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
fn cluster_shards<S>(&mut self) -> PreparedCommand<'_, Self, S>
where Self: Sized,
S: FromSingleValueArray<ClusterShardResult> { ... }
fn readonly(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
fn readwrite(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized { ... }
}
Expand description
A group of Redis commands related to Cluster Management
§See Also
Redis Cluster Management commands Redis cluster specification
Provided Methods§
Sourcefn asking(&mut self) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
fn asking(&mut self) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
When a cluster client receives an -ASK redirect, the ASKING command is sent to the target node followed by the command which was redirected. This is normally done automatically by cluster clients.
§See Also
Sourcefn cluster_addslots<S>(&mut self, slots: S) -> PreparedCommand<'_, Self, ()>
fn cluster_addslots<S>(&mut self, slots: S) -> PreparedCommand<'_, Self, ()>
This command is useful in order to modify a node’s view of the cluster configuration.
Specifically it assigns a set of hash slots to the node receiving the command. If the command is successful, the node will map the specified hash slots to itself, and will start broadcasting the new configuration.
§See Also
Sourcefn cluster_addslotsrange<S>(
&mut self,
slots: S,
) -> PreparedCommand<'_, Self, ()>
fn cluster_addslotsrange<S>( &mut self, slots: S, ) -> PreparedCommand<'_, Self, ()>
This command is similar to the cluster_addslots
command in that they both assign hash slots to nodes.
The difference between the two commands is that cluster_addslots
takes a list of slots to assign to the node, while this command takes a list of slot ranges
(specified by a tuple containing start and end slots) to assign to the node.
§See Also
Sourcefn cluster_bumpepoch(
&mut self,
) -> PreparedCommand<'_, Self, ClusterBumpEpochResult>where
Self: Sized,
fn cluster_bumpepoch(
&mut self,
) -> PreparedCommand<'_, Self, ClusterBumpEpochResult>where
Self: Sized,
Sourcefn cluster_count_failure_reports<I>(
&mut self,
node_id: I,
) -> PreparedCommand<'_, Self, usize>
fn cluster_count_failure_reports<I>( &mut self, node_id: I, ) -> PreparedCommand<'_, Self, usize>
Sourcefn cluster_countkeysinslot(
&mut self,
slot: usize,
) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
fn cluster_countkeysinslot(
&mut self,
slot: usize,
) -> PreparedCommand<'_, Self, usize>where
Self: Sized,
Sourcefn cluster_delslots<S>(&mut self, slots: S) -> PreparedCommand<'_, Self, ()>
fn cluster_delslots<S>(&mut self, slots: S) -> PreparedCommand<'_, Self, ()>
In Redis Cluster, each node keeps track of which master is serving a particular hash slot. This command asks a particular Redis Cluster node to forget which master is serving the hash slots specified as arguments.
§See Also
Sourcefn cluster_delslotsrange<S>(
&mut self,
slots: S,
) -> PreparedCommand<'_, Self, ()>
fn cluster_delslotsrange<S>( &mut self, slots: S, ) -> PreparedCommand<'_, Self, ()>
This command is similar to the cluster_delslotsrange
command in that they both remove hash slots from the node.
The difference is that cluster_delslotsrange
takes a list of hash slots to remove from the node,
while this command takes a list of slot ranges (specified by a tuple containing start and end slots) to remove from the node.
§See Also
Sourcefn cluster_failover(
&mut self,
option: ClusterFailoverOption,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
fn cluster_failover(
&mut self,
option: ClusterFailoverOption,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
Sourcefn cluster_flushslots(&mut self) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
fn cluster_flushslots(&mut self) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
Sourcefn cluster_forget<I>(&mut self, node_id: I) -> PreparedCommand<'_, Self, ()>
fn cluster_forget<I>(&mut self, node_id: I) -> PreparedCommand<'_, Self, ()>
The command is used in order to remove a node, specified via its node ID, from the set of known nodes of the Redis Cluster node receiving the command. In other words the specified node is removed from the nodes table of the node receiving the command.
§See Also
Sourcefn cluster_getkeysinslot(
&mut self,
slot: u16,
count: usize,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
fn cluster_getkeysinslot(
&mut self,
slot: u16,
count: usize,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
The command returns an array of keys names stored in the contacted node and hashing to the specified hash slot.
The maximum number of keys to return is specified via the count argument, so that it is possible for the user of this API to batch-processing keys.
§See Also
Sourcefn cluster_info(
&mut self,
slot: u16,
count: usize,
) -> PreparedCommand<'_, Self, ClusterInfo>where
Self: Sized,
fn cluster_info(
&mut self,
slot: u16,
count: usize,
) -> PreparedCommand<'_, Self, ClusterInfo>where
Self: Sized,
Sourcefn cluster_keyslot<K>(&mut self, key: K) -> PreparedCommand<'_, Self, u16>
fn cluster_keyslot<K>(&mut self, key: K) -> PreparedCommand<'_, Self, u16>
Sourcefn cluster_links<I>(&mut self) -> PreparedCommand<'_, Self, Vec<I>>
fn cluster_links<I>(&mut self) -> PreparedCommand<'_, Self, Vec<I>>
Each node in a Redis Cluster maintains a pair of long-lived TCP link with each peer in the cluster:
- One for sending outbound messages towards the peer
- and one for receiving inbound messages from the peer.
This command outputs information of all such peer links as an array, where each array element is a struct that contains attributes and their values for an individual link.
§Return
An array of structs where each struct contains various attributes and their values of a cluster link.
§See Also
Sourcefn cluster_meet<IP>(
&mut self,
ip: IP,
port: u16,
cluster_bus_port: Option<u16>,
) -> PreparedCommand<'_, Self, ()>
fn cluster_meet<IP>( &mut self, ip: IP, port: u16, cluster_bus_port: Option<u16>, ) -> PreparedCommand<'_, Self, ()>
Sourcefn cluster_myid<N>(&mut self) -> PreparedCommand<'_, Self, N>
fn cluster_myid<N>(&mut self) -> PreparedCommand<'_, Self, N>
Sourcefn cluster_nodes<R>(&mut self) -> PreparedCommand<'_, Self, R>
fn cluster_nodes<R>(&mut self) -> PreparedCommand<'_, Self, R>
Each node in a Redis Cluster has its view of the current cluster configuration, given by the set of known nodes, the state of the connection we have with such nodes, their flags, properties and assigned slots, and so forth.
This command provides all this information, that is, the current cluster configuration of the node we are contacting, in a serialization format which happens to be exactly the same as the one used by Redis Cluster itself in order to store on disk the cluster state (however the on disk cluster state has a few additional info appended at the end).
§Return
The serialized cluster configuration. The output of the command is just a space-separated CSV string, where each line represents a node in the cluster.
§See Also
Sourcefn cluster_replicas<I, R>(&mut self, node_id: I) -> PreparedCommand<'_, Self, R>
fn cluster_replicas<I, R>(&mut self, node_id: I) -> PreparedCommand<'_, Self, R>
The command provides a list of replica nodes replicating from the specified master node.
§Return
The command returns data in the same format as cluster_nodes
.
§See Also
Sourcefn cluster_replicate<I>(&mut self, node_id: I) -> PreparedCommand<'_, Self, ()>
fn cluster_replicate<I>(&mut self, node_id: I) -> PreparedCommand<'_, Self, ()>
The command reconfigures a node as a replica of the specified master. If the node receiving the command is an empty master, as a side effect of the command, the node role is changed from master to replica.
§See Also
Sourcefn cluster_reset(
&mut self,
reset_type: ClusterResetType,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
fn cluster_reset(
&mut self,
reset_type: ClusterResetType,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
Reset a Redis Cluster node, in a more or less drastic way depending on the reset type, that can be hard or soft.
§See Also
Sourcefn cluster_saveconfig(&mut self) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
fn cluster_saveconfig(&mut self) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
Forces a node to save the nodes.conf configuration on disk.
Before to return the command calls fsync(2)
in order to make sure the configuration is flushed on the computer disk.
§See Also
Sourcefn cluster_set_config_epoch(
&mut self,
config_epoch: u64,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
fn cluster_set_config_epoch(
&mut self,
config_epoch: u64,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
This command sets a specific config epoch in a fresh node.
§See Also
Sourcefn cluster_setslot(
&mut self,
slot: u16,
subcommand: ClusterSetSlotSubCommand,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
fn cluster_setslot(
&mut self,
slot: u16,
subcommand: ClusterSetSlotSubCommand,
) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
This command is responsible of changing the state of a hash slot in the receiving node in different ways.
§See Also
Sourcefn cluster_shards<S>(&mut self) -> PreparedCommand<'_, Self, S>
fn cluster_shards<S>(&mut self) -> PreparedCommand<'_, Self, S>
Sourcefn readonly(&mut self) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
fn readonly(&mut self) -> PreparedCommand<'_, Self, ()>where
Self: Sized,
Enables read queries for a connection to a Redis Cluster replica node.