MCPcopy
hub / github.com/uber/aresdb / ComputeHLLValue

Function ComputeHLLValue

utils/hll.go:25–37  ·  view source on GitHub ↗

ComputeHLLValue compute hll value based on hash value

(hash uint64)

Source from the content-addressed store, hash-verified

23
24// ComputeHLLValue compute hll value based on hash value
25func ComputeHLLValue(hash uint64) uint32 {
26 group := uint32(hash & ((1 << groupBits) - 1))
27 var rho uint32
28 for {
29 h := hash & (1 << (rho + groupBits))
30 if rho+groupBits < 64 && h == 0 {
31 rho++
32 } else {
33 break
34 }
35 }
36 return rho<<maxGroupBits | group
37}

Callers 2

computeHLLValueFunction · 0.92
hll_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected