Trait fred::interfaces::ClusterInterface

source ·
pub trait ClusterInterface: ClientLike + Sized {
Show 24 methods // Provided methods fn cached_cluster_state(&self) -> Option<ClusterRouting> { ... } fn num_primary_cluster_nodes(&self) -> usize { ... } fn sync_cluster(&self) -> impl Future<Output = Result<(), RedisError>> { ... } fn cluster_bumpepoch<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn cluster_flushslots(&self) -> impl Future<Output = RedisResult<()>> { ... } fn cluster_myid<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn cluster_nodes<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn cluster_saveconfig(&self) -> impl Future<Output = RedisResult<()>> { ... } fn cluster_slots<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn cluster_info<R>(&self) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn cluster_add_slots<S>( &self, slots: S, ) -> impl Future<Output = RedisResult<()>> where S: Into<MultipleHashSlots> { ... } fn cluster_count_failure_reports<R, S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, S: Into<Str> { ... } fn cluster_count_keys_in_slot<R>( &self, slot: u16, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn cluster_del_slots<S>( &self, slots: S, ) -> impl Future<Output = RedisResult<()>> where S: Into<MultipleHashSlots> { ... } fn cluster_failover( &self, flag: Option<ClusterFailoverFlag>, ) -> impl Future<Output = RedisResult<()>> { ... } fn cluster_forget<S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<()>> where S: Into<Str> { ... } fn cluster_get_keys_in_slot<R>( &self, slot: u16, count: u64, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis { ... } fn cluster_keyslot<R, K>( &self, key: K, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, K: Into<RedisKey> { ... } fn cluster_meet<S>( &self, ip: S, port: u16, ) -> impl Future<Output = RedisResult<()>> where S: Into<Str> { ... } fn cluster_replicate<S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<()>> where S: Into<Str> { ... } fn cluster_replicas<R, S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<R>> where R: FromRedis, S: Into<Str> { ... } fn cluster_reset( &self, mode: Option<ClusterResetFlag>, ) -> impl Future<Output = RedisResult<()>> { ... } fn cluster_set_config_epoch( &self, epoch: u64, ) -> impl Future<Output = RedisResult<()>> { ... } fn cluster_setslot( &self, slot: u16, state: ClusterSetSlotState, ) -> impl Future<Output = RedisResult<()>> { ... }
}
Available on crate feature i-cluster only.
Expand description

Functions that implement the cluster interface.

Provided Methods§

source

fn cached_cluster_state(&self) -> Option<ClusterRouting>

Read the cached cluster state used for routing commands to the correct cluster nodes.

source

fn num_primary_cluster_nodes(&self) -> usize

Read the number of known primary cluster nodes, or 0 if the cluster state is not known.

source

fn sync_cluster(&self) -> impl Future<Output = Result<(), RedisError>>

Update the cached cluster state and add or remove any changed cluster node connections.

source

fn cluster_bumpepoch<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Advances the cluster config epoch.

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

source

fn cluster_flushslots(&self) -> impl Future<Output = RedisResult<()>>

Deletes all slots from a node.

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

source

fn cluster_myid<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Returns the node’s id.

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

source

fn cluster_nodes<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

Read the current cluster node configuration.

Note: The client keeps a cached, parsed version of the cluster state in memory available at cached_cluster_state.

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

source

fn cluster_saveconfig(&self) -> impl Future<Output = RedisResult<()>>

Forces a node to save the nodes.conf configuration on disk.

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

source

fn cluster_slots<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

CLUSTER SLOTS returns details about which cluster slots map to which Redis instances.

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

source

fn cluster_info<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

CLUSTER INFO provides INFO style information about Redis Cluster vital parameters.

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

source

fn cluster_add_slots<S>( &self, slots: S, ) -> impl Future<Output = RedisResult<()>>

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.

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

source

fn cluster_count_failure_reports<R, S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

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

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

source

fn cluster_count_keys_in_slot<R>( &self, slot: u16, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

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

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

source

fn cluster_del_slots<S>( &self, slots: S, ) -> impl Future<Output = RedisResult<()>>

The CLUSTER DELSLOTS command asks a particular Redis Cluster node to forget which master is serving the hash slots specified as arguments.

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

source

fn cluster_failover( &self, flag: Option<ClusterFailoverFlag>, ) -> impl Future<Output = RedisResult<()>>

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.

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

source

fn cluster_forget<S>(&self, node_id: S) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>,

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.

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

source

fn cluster_get_keys_in_slot<R>( &self, slot: u16, count: u64, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,

The command returns an array of keys names stored in the contacted node and hashing to the specified hash slot.

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

source

fn cluster_keyslot<R, K>(&self, key: K) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, K: Into<RedisKey>,

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

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

source

fn cluster_meet<S>( &self, ip: S, port: u16, ) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>,

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

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

source

fn cluster_replicate<S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>,

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.

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

source

fn cluster_replicas<R, S>( &self, node_id: S, ) -> impl Future<Output = RedisResult<R>>
where R: FromRedis, S: Into<Str>,

The command provides a list of replica nodes replicating from the specified master node.

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

source

fn cluster_reset( &self, mode: Option<ClusterResetFlag>, ) -> impl Future<Output = RedisResult<()>>

Reset a Redis Cluster node, in a more or less drastic way depending on the reset type, that can be hard or soft. Note that this command does not work for masters if they hold one or more keys, in that case to completely reset a master node keys must be removed first, e.g. by using FLUSHALL first, and then CLUSTER RESET.

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

source

fn cluster_set_config_epoch( &self, epoch: u64, ) -> impl Future<Output = RedisResult<()>>

This command sets a specific config epoch in a fresh node.

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

source

fn cluster_setslot( &self, slot: u16, state: ClusterSetSlotState, ) -> impl Future<Output = RedisResult<()>>

CLUSTER SETSLOT is responsible for changing the state of a hash slot in the receiving node in different ways.

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

Object Safety§

This trait is not object safe.

Implementors§