MCPcopy Index your code
hub / github.com/aceld/zinx / GetShard

Method GetShard

zutils/shard_lock_map.go:76–78  ·  view source on GitHub ↗

GetShard returns shard under given key

(key string)

Source from the content-addressed store, hash-verified

74
75// GetShard returns shard under given key
76func (slm ShardLockMaps) GetShard(key string) *SingleShardMap {
77 return slm.shards[slm.hash.Sum(key)%uint32(slm.shardCount)]
78}
79
80// Count returns the number of elements within the map.
81func (slm ShardLockMaps) Count() int {

Callers 12

GetMethod · 0.95
SetMethod · 0.95
SetNXMethod · 0.95
MSetMethod · 0.95
HasMethod · 0.95
RemoveMethod · 0.95
RemoveCbMethod · 0.95
PopMethod · 0.95
doSetWithLockCheckMethod · 0.95
LockFuncWithKeyMethod · 0.95
RLockFuncWithKeyMethod · 0.95

Calls 1

SumMethod · 0.65

Tested by

no test coverage detected