Trait ClusterCommands

Source
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

Provided Methods§

Source

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

https://redis.io/commands/asking/

Source

fn cluster_addslots<S>(&mut self, slots: S) -> PreparedCommand<'_, Self, ()>
where Self: Sized, S: SingleArgOrCollection<u16>,

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

https://redis.io/commands/cluster-addslots/

Source

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

https://redis.io/commands/cluster-addslotsrange/

Source

fn cluster_bumpepoch( &mut self, ) -> PreparedCommand<'_, Self, ClusterBumpEpochResult>
where Self: Sized,

Advances the cluster config epoch.

§Return
  • Bumped if the epoch was incremented, or
  • Still if the node already has the greatest config epoch in the cluster.
§See Also

https://redis.io/commands/cluster-bumpepoch/

Source

fn cluster_count_failure_reports<I>( &mut self, node_id: I, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized, I: Into<CommandArg>,

The command returns the number of failure reports for the specified node.

§Return

The number of active failure reports for the node.

§See Also

https://redis.io/commands/cluster-count-failure-reports/

Source

fn cluster_countkeysinslot( &mut self, slot: usize, ) -> PreparedCommand<'_, Self, usize>
where Self: Sized,

Returns the number of keys in the specified Redis Cluster hash slot.

§Return

The number of keys in the specified hash slot, or an error if the hash slot is invalid.

§See Also

https://redis.io/commands/cluster-countkeysinslot/

Source

fn cluster_delslots<S>(&mut self, slots: S) -> PreparedCommand<'_, Self, ()>
where Self: Sized, S: SingleArgOrCollection<u16>,

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

https://redis.io/commands/cluster-delslots/

Source

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

https://redis.io/commands/cluster-delslotsrange/

Source

fn cluster_failover( &mut self, option: ClusterFailoverOption, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

This command, that can only be sent to a Redis Cluster replica node, forces the replica to start a manual failover of its master instance.

§Errors

An error cann occured if the operation cannot be executed, for example if we are talking with a node which is already a master.

§See Also

https://redis.io/commands/cluster-failover/

Source

fn cluster_flushslots(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

Deletes all slots from a node.

§See Also

https://redis.io/commands/cluster-flushslots/

Source

fn cluster_forget<I>(&mut self, node_id: I) -> PreparedCommand<'_, Self, ()>
where Self: Sized, I: Into<CommandArg>,

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

https://redis.io/commands/cluster-forget/

Source

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

https://redis.io/commands/cluster-getkeysinslot/

Source

fn cluster_info( &mut self, slot: u16, count: usize, ) -> PreparedCommand<'_, Self, ClusterInfo>
where Self: Sized,

This command provides info style information about Redis Cluster vital parameters.

§Return

The Cluster information

§See Also

https://redis.io/commands/cluster-info/

Source

fn cluster_keyslot<K>(&mut self, key: K) -> PreparedCommand<'_, Self, u16>
where Self: Sized, K: Into<CommandArg>,

Returns an integer identifying the hash slot the specified key hashes to.

§Return

The hash slot number.

§See Also

https://redis.io/commands/cluster-keyslot/

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

https://redis.io/commands/cluster-links/

Source

fn cluster_meet<IP>( &mut self, ip: IP, port: u16, cluster_bus_port: Option<u16>, ) -> PreparedCommand<'_, Self, ()>
where Self: Sized, IP: Into<CommandArg>,

This command is used in order to connect different Redis nodes with cluster support enabled, into a working cluster.

§Return

An array of structs where each struct contains various attributes and their values of a cluster link.

§See Also

https://redis.io/commands/cluster-meet/

Source

fn cluster_myid<N>(&mut self) -> PreparedCommand<'_, Self, N>
where Self: Sized, N: FromValue,

This command returns the unique, auto-generated identifier that is associated with the connected cluster node.

§Return

The node id.

§See Also

https://redis.io/commands/cluster-myid/

Source

fn cluster_nodes<R>(&mut self) -> PreparedCommand<'_, Self, R>
where Self: Sized, R: FromValue,

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

https://redis.io/commands/cluster-nodes/

Source

fn cluster_replicas<I, R>(&mut self, node_id: I) -> PreparedCommand<'_, Self, R>
where Self: Sized, I: Into<CommandArg>, R: FromValue,

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

https://redis.io/commands/cluster-replicas/

Source

fn cluster_replicate<I>(&mut self, node_id: I) -> PreparedCommand<'_, Self, ()>
where Self: Sized, I: Into<CommandArg>,

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

https://redis.io/commands/cluster-replicate/

Source

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

https://redis.io/commands/cluster-reset/

Source

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

https://redis.io/commands/cluster-saveconfig/

Source

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

https://redis.io/commands/cluster-set-config-epoch/

Source

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

https://redis.io/commands/cluster-setslot/

Source

fn cluster_shards<S>(&mut self) -> PreparedCommand<'_, Self, S>

This command returns details about the shards of the cluster.

§Return

A list of shard information for each shard (slot ranges & shard nodes)

§See Also

https://redis.io/commands/cluster-shards/

Source

fn readonly(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

Enables read queries for a connection to a Redis Cluster replica node.

§See Also

https://redis.io/commands/readonly/

Source

fn readwrite(&mut self) -> PreparedCommand<'_, Self, ()>
where Self: Sized,

Disables read queries for a connection to a Redis Cluster replica node.

§See Also

https://redis.io/commands/readwrite/

Implementors§