bloomManager

package
v0.0.0-...-9df1057 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BloomFilter

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

BloomFilter struct holds the pointer to the bloomFilter object

func New

func New(numEmail uint, fpProb float64) *BloomFilter

New is called to instantiate a new BloomFilter object

func (*BloomFilter) DetermineUpdateOrRepopulate

func (bf *BloomFilter) DetermineUpdateOrRepopulate(tableNum int)

DetermineUpdateOrRepopulate determines whether to repopulate or update and then does it

func (*BloomFilter) GetArrayOfUnsubscribedEmails

func (bf *BloomFilter) GetArrayOfUnsubscribedEmails(dataSet map[int][]string) map[int][]string

GetArrayOfUnsubscribedEmails given a map of user_id:[emails] will return a map[user_id]:[emails] of those that exist in the db

func (*BloomFilter) GetStats

func (bf *BloomFilter) GetStats(dbSize uint) float64

GetStats returns false positive rate of bloom filter based on input size

func (*BloomFilter) QueryUnsubscribed

func (bf *BloomFilter) QueryUnsubscribed(dataSet map[int][]string) map[int][]string

QueryUnsubscribed given a map[int][]string will query the db and return a map[int][]string of those that exist in the db

func (*BloomFilter) RepopulateBloomFilter

func (bf *BloomFilter) RepopulateBloomFilter(tableNum int)

RepopulateBloomFilter will be called if emails are removed from the database (customers resubscribe) also used to initially populate bloom filter

func (*BloomFilter) UpdateBloomFilter

func (bf *BloomFilter) UpdateBloomFilter(tableNum int)

UpdateBloomFilter will be called if emails are added to the database (unsubscribe emails), determine what is new and add to bf bit array

Jump to

Keyboard shortcuts

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