psync::detail::IBLT Class Reference

Invertible Bloom Lookup Table (Invertible Bloom Filter) More...

#include <PSync/detail/iblt.hpp>

Classes

class  Error
 

Public Member Functions

 IBLT (size_t expectedNumEntries, CompressionScheme scheme)
 constructor More...
 
void appendToName (ndn::Name &name) const
 Appends self to name. More...
 
void erase (uint32_t key)
 
std::vector< uint32_t > extractValueFromName (const ndn::name::Component &ibltName) const
 Extracts IBLT from name component. More...
 
const std::vector< HashTableEntry > & getHashTable () const
 
void initialize (const ndn::name::Component &ibltName)
 Populate the hash table using the vector representation of IBLT. More...
 
void insert (uint32_t key)
 
bool listEntries (std::set< uint32_t > &positive, std::set< uint32_t > &negative) const
 List all the entries in the IBLT. More...
 
IBLT operator- (const IBLT &other) const
 

Detailed Description

Invertible Bloom Lookup Table (Invertible Bloom Filter)

Used by Partial Sync (PartialProducer) and Full Sync (Full Producer)

Definition at line 80 of file iblt.hpp.

Constructor & Destructor Documentation

◆ IBLT()

psync::detail::IBLT::IBLT ( size_t  expectedNumEntries,
CompressionScheme  scheme 
)
explicit

constructor

Parameters
expectedNumEntriesthe expected number of entries in the IBLT
schemecompression scheme to be used for the IBLT

Definition at line 72 of file iblt.cpp.

Member Function Documentation

◆ appendToName()

void psync::detail::IBLT::appendToName ( ndn::Name &  name) const

Appends self to name.

Encodes our hash table from uint32_t vector to uint8_t vector We create a uin8_t vector 12 times the size of uint32_t vector We put the first count in first 4 cells, keySum in next 4, and keyCheck in next 4. Repeat for all the other cells of the hash table. Then we append this uint8_t vector to the name.

Definition at line 183 of file iblt.cpp.

◆ erase()

void psync::detail::IBLT::erase ( uint32_t  key)

Definition at line 127 of file iblt.cpp.

◆ extractValueFromName()

std::vector< uint32_t > psync::detail::IBLT::extractValueFromName ( const ndn::name::Component &  ibltName) const

Extracts IBLT from name component.

Converts the name into a uint8_t vector which is then decoded to a a uint32_t vector.

Parameters
ibltNameIBLT represented as a Name Component
Returns
a uint32_t vector representing the hash table of the IBLT

Definition at line 207 of file iblt.cpp.

◆ getHashTable()

const std::vector<HashTableEntry>& psync::detail::IBLT::getHashTable ( ) const
inline

Definition at line 129 of file iblt.hpp.

◆ initialize()

void psync::detail::IBLT::initialize ( const ndn::name::Component &  ibltName)

Populate the hash table using the vector representation of IBLT.

Parameters
ibltNamethe Component representation of IBLT
Exceptions
Errorif size of values is not compatible with this IBF

Definition at line 87 of file iblt.cpp.

◆ insert()

void psync::detail::IBLT::insert ( uint32_t  key)

Definition at line 121 of file iblt.cpp.

◆ listEntries()

bool psync::detail::IBLT::listEntries ( std::set< uint32_t > &  positive,
std::set< uint32_t > &  negative 
) const

List all the entries in the IBLT.

This is called on a difference of two IBLTs: ownIBLT - rcvdIBLT Entries listed in positive are in ownIBLT but not in rcvdIBLT Entries listed in negative are in rcvdIBLT but not in ownIBLT

Returns
whether decoding completed successfully

Definition at line 133 of file iblt.cpp.

◆ operator-()

IBLT psync::detail::IBLT::operator- ( const IBLT other) const

Definition at line 166 of file iblt.cpp.