pbloom

package module
v0.0.0-...-0e9aeca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2018 License: Apache-2.0 Imports: 3 Imported by: 1

README

pbloom

bit level parallel bloom filter

Documentation

Index

Constants

View Source
const BatchPutLocationsPerElement = 4
View Source
const SlotNotFound = biter.NotFound

Variables

This section is empty.

Functions

func BatchPut

func BatchPut(hashedElement HashedElement,
	slotMask1 biter.Bits, slotMask2 biter.Bits, slotMask3 biter.Bits,
	pbf1 ParallelBloomFilter, pbf2 ParallelBloomFilter, pbf3 ParallelBloomFilter) [4]uint64

Types

type BloomElement

type BloomElement []uint64

type HashedElement

type HashedElement [2]uint32

func HasherFnv

func HasherFnv(element []byte) (s HashedElement)

copied stdlib hash/fnv

func (HashedElement) DownCastToUint32

func (hashedElement HashedElement) DownCastToUint32() uint32

func (HashedElement) Hash

func (hashedElement HashedElement) Hash(locationsPerElement uint64, locationsCount uint64) BloomElement

type Hasher

type Hasher func(element []byte) HashedElement

element => hash1,hash2 => k locations

type HashingStrategy

type HashingStrategy struct {
	// contains filtered or unexported fields
}

func NewHashingStrategy

func NewHashingStrategy(hasher Hasher, locationsCount, locationsPerElement uint64) *HashingStrategy

func (*HashingStrategy) Find

func (strategy *HashingStrategy) Find(pbf ParallelBloomFilter, element []byte) biter.Bits

func (*HashingStrategy) Hash

func (strategy *HashingStrategy) Hash(element []byte) BloomElement

func (*HashingStrategy) HashStage1

func (strategy *HashingStrategy) HashStage1(element []byte) HashedElement

func (*HashingStrategy) HashStage2

func (strategy *HashingStrategy) HashStage2(hashedElement HashedElement) BloomElement

func (*HashingStrategy) New

func (strategy *HashingStrategy) New() ParallelBloomFilter

func (*HashingStrategy) Put

func (strategy *HashingStrategy) Put(pbf ParallelBloomFilter, slotMask biter.Bits, element []byte)

type ParallelBloomFilter

type ParallelBloomFilter []biter.Bits

64 slotMask bloom filter

func (ParallelBloomFilter) Find

func (pbf ParallelBloomFilter) Find(element BloomElement) biter.Bits

func (ParallelBloomFilter) Put

func (pbf ParallelBloomFilter) Put(slotMask biter.Bits, element BloomElement)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL