\seekquarry\yioop\libraryBloomFilterBundle

A BloomFilterBundle is a directory of BloomFilterFile.

The filter bundle, like a Bloom filter, also acts as a set, but once the active filter in it fills up a new filter is added to the bundle so that more data can be stored.

Summary

Methods
Properties
Constants
__construct()
add()
differenceFilter()
loadMetaData()
saveMetaData()
reset()
forceSave()
$current_filter
$num_filters
$current_filter_count
$filter_size
$dir_name
default_filter_size
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

default_filter_size

default_filter_size

The default maximum size of a filter in a filter bundle

Properties

$current_filter

$current_filter : object

Reference to the filter which will be used to store new data

Type

object

$num_filters

$num_filters : integer

Total number of filter that this filter bundle currently has

Type

integer

$current_filter_count

$current_filter_count : integer

The number of items which have been stored in the current filter

Type

integer

$filter_size

$filter_size : integer

The maximum capacity of a filter in this filter bundle

Type

integer

$dir_name

$dir_name : string

The folder name of this filter bundle

Type

string

Methods

__construct()

__construct(  $dir_name,   $filter_size = self::default_filter_size) 

Creates or loads if already exists the directory structure and BloomFilterFiles used by this bundle

Parameters

$dir_name

directory when this bundles data is stored

$filter_size

the size of an individual filter in this bundle once a filter is filled a new one is added to the directory

add()

add(string  $value) 

Inserts a $value into the BloomFilterBundle

This involves inserting into the current filter, if the filter is full, a new filter is added before the value is added

Parameters

string $value

a item to add to the filter bundle

differenceFilter()

differenceFilter(\seekquarry\yioop\library\array&  $arr, array  $field_names = null) 

Removes from the passed array those elements $elt who either are in the filter bundle or whose $elt[$field_name] is in the bundle.

Parameters

\seekquarry\yioop\library\array& $arr

the array to remove elements from

array $field_names

if not null an array of field names of $arr to use to do filtering

loadMetaData()

loadMetaData() 

Loads from the filter bundles' meta.txt the meta data associated with this filter bundle and stores this data into field variables

saveMetaData()

saveMetaData() 

Saves the meta data (number of filter, number of items stored, and size) of the bundle

reset()

reset() 

Empties the contents of the bloom filter bundle and resets it to start storing new data.

forceSave()

forceSave() 

Used to save to disk all the file data associated with this bundle