Test implements bloom.Test -> required only for testing
(traceID []byte)
| 76 | |
| 77 | // Test implements bloom.Test -> required only for testing |
| 78 | func (b *ShardedBloomFilter) Test(traceID []byte) bool { |
| 79 | shardKey := ShardKeyForTraceID(traceID, len(b.blooms)) |
| 80 | return b.blooms[shardKey].Test(traceID) |
| 81 | } |
| 82 | |
| 83 | func ShardKeyForTraceID(traceID []byte, shardCount int) int { |
| 84 | return int(util.TokenForTraceID(traceID)) % ValidateShardCount(shardCount) |