MCPcopy
hub / github.com/redis/redis-py / get_nodes_from_slot

Method get_nodes_from_slot

redis/cluster.py:1069–1080  ·  view source on GitHub ↗

Returns a list of nodes that hold the specified keys' slots.

(self, command: str, *args)

Source from the content-addressed store, hash-verified

1067 return self.nodes_manager.default_node
1068
1069 def get_nodes_from_slot(self, command: str, *args):
1070 """
1071 Returns a list of nodes that hold the specified keys' slots.
1072 """
1073 # get the node that holds the key's slot
1074 slot = self.determine_slot(*args)
1075 node = self.nodes_manager.get_node_from_slot(
1076 slot,
1077 self.read_from_replicas and command in READ_COMMANDS,
1078 self.load_balancing_strategy if command in READ_COMMANDS else None,
1079 )
1080 return [node]
1081
1082 def _split_multi_shard_command(self, *args, **kwargs) -> list[dict]:
1083 """

Callers 4

__init__Method · 0.95
__init__Method · 0.45

Calls 2

determine_slotMethod · 0.95
get_node_from_slotMethod · 0.45