CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SmallhashFilter Class Reference

#include <hash_filter.h>

Inheritance diagram for SmallhashFilter:
Collaboration diagram for SmallhashFilter:

Public Member Functions

 SmallhashFilter ()
 
void Fill (const shash::Any &hash)
 
bool Contains (const shash::Any &hash) const
 
void Freeze ()
 
size_t Count () const
 
- Public Member Functions inherited from AbstractHashFilter
virtual ~AbstractHashFilter ()
 

Static Protected Member Functions

static uint32_t hasher (const shash::Any &key)
 

Private Attributes

SmallHashDynamic< shash::Any,
bool > 
hashmap_
 
bool frozen_
 

Detailed Description

This is an implementation of AbstractHashFilter using the SmallHash structure for internal storage.

Definition at line 95 of file hash_filter.h.

Constructor & Destructor Documentation

SmallhashFilter::SmallhashFilter ( )
inline

Definition at line 103 of file hash_filter.h.

Here is the call graph for this function:

Member Function Documentation

bool SmallhashFilter::Contains ( const shash::Any hash) const
inlinevirtual

Decides if a presented hash is in the filter or not Depending on the concrete implementation of this method it could be a prob- abilistic answer. However, implementations should ensure a recall rate of 100%, say: never produce false negatives.

Parameters
hashthe hash to be queried
Returns
true if the hash is (probably) contained in the set false if it is definitely not in the set

Implements AbstractHashFilter.

Definition at line 115 of file hash_filter.h.

Here is the call graph for this function:

size_t SmallhashFilter::Count ( ) const
inlinevirtual

Returns the number of objects already inserted into the filter.

Returns
number of objects in the filter

Implements AbstractHashFilter.

Definition at line 120 of file hash_filter.h.

Here is the call graph for this function:

void SmallhashFilter::Fill ( const shash::Any hash)
inlinevirtual

Adds the given hash to the filter

Parameters
hashthe hash to be added to the HashFilter

Implements AbstractHashFilter.

Definition at line 110 of file hash_filter.h.

Referenced by swissknife::CommandGc::Main().

Here is the call graph for this function:

Here is the caller graph for this function:

void SmallhashFilter::Freeze ( )
inlinevirtual

Freezes the filter after filling it with all values. This is not necessary but could be used for certain optimizations depending on the implementation of the AbstractHashFilter. Note: After Freeze() has been called, Fill() should fail!

Reimplemented from AbstractHashFilter.

Definition at line 119 of file hash_filter.h.

static uint32_t SmallhashFilter::hasher ( const shash::Any key)
inlinestaticprotected

Definition at line 97 of file hash_filter.h.

Referenced by SmallhashFilter().

Here is the caller graph for this function:

Member Data Documentation

bool SmallhashFilter::frozen_
private

Definition at line 124 of file hash_filter.h.

Referenced by Fill(), and Freeze().

SmallHashDynamic<shash::Any, bool> SmallhashFilter::hashmap_
private

Definition at line 123 of file hash_filter.h.

Referenced by Contains(), Count(), Fill(), and SmallhashFilter().


The documentation for this class was generated from the following file: