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

Method keyslot

redis/cluster.py:1365–1371  ·  view source on GitHub ↗

Calculate keyslot for a given key. See Keys distribution model in https://redis.io/topics/cluster-spec

(self, key)

Source from the content-addressed store, hash-verified

1363 return self.reinitialize_counter % self.reinitialize_steps == 0
1364
1365 def keyslot(self, key):
1366 """
1367 Calculate keyslot for a given key.
1368 See Keys distribution model in https://redis.io/topics/cluster-spec
1369 """
1370 k = self.encoder.encode(key)
1371 return key_slot(k)
1372
1373 def _get_command_keys(self, *args):
1374 """

Calls 2

key_slotFunction · 0.90
encodeMethod · 0.80