Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
3
import
"hash/fnv"
4
5
func
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
isUserOwned
Method · 0.92
GetPositionForUser
Method · 0.92
ReplicateStateForUser
Method · 0.92
ReadFullStateForUser
Method · 0.92
doQuorum
Method · 0.92
doUnary
Method · 0.92
isUserOwned
Method · 0.92
Calls
1
Write
Method · 0.45
Tested by
no test coverage detected