Enum rustis::commands::RequestPolicy
source · pub enum RequestPolicy {
AllNodes,
AllShards,
MultiShard,
Special,
}
Expand description
This tip can help clients determine the shards to send the command in clustering mode.
The default behavior a client should implement for commands without the request_policy tip is as follows:
- The command doesn’t accept key name arguments: the client can execute the command on an arbitrary shard.
- For commands that accept one or more key name arguments: the client should route the command to a single shard, as determined by the hash slot of the input keys.
Variants§
AllNodes
the client should execute the command on all nodes - masters and replicas alike.
An example is the config_set
command.
This tip is in-use by commands that don’t accept key name arguments. The command operates atomically per shard.
AllShards
the client should execute the command on all master shards (e.g., the dbsize
command).
This tip is in-use by commands that don’t accept key name arguments. The command operates atomically per shard.
MultiShard
the client should execute the command on several shards.
The shards that execute the command are determined by the hash slots of its input key name arguments.
Examples for such commands include mset
, mget
and del
.
However, note that sunionstore
isn’t considered
as multi_shard because all of its keys must belong to the same hash slot.
Special
indicates a non-trivial form of the client’s request policy, such as the scan
command.
Trait Implementations§
source§impl Clone for RequestPolicy
impl Clone for RequestPolicy
source§fn clone(&self) -> RequestPolicy
fn clone(&self) -> RequestPolicy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more