MCPcopy Create free account
hub / github.com/cortexproject/cortex / ShardByUser

Function ShardByUser

pkg/util/users/shard.go:5–10  ·  view source on GitHub ↗
(userID string)

Source from the content-addressed store, hash-verified

3import "hash/fnv"
4
5func ShardByUser(userID string) uint32 {
6 ringHasher := fnv.New32a()
7 // Hasher never returns err.
8 _, _ = ringHasher.Write([]byte(userID))
9 return ringHasher.Sum32()
10}

Callers 7

isUserOwnedMethod · 0.92
GetPositionForUserMethod · 0.92
ReplicateStateForUserMethod · 0.92
ReadFullStateForUserMethod · 0.92
doQuorumMethod · 0.92
doUnaryMethod · 0.92
isUserOwnedMethod · 0.92

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected