Zero  0.1.0
Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | List of all members
verification_context Class Reference

The context object maintained throughout the verification. More...

#include <btree_verify.h>

Public Member Functions

 verification_context (int hash_bits)
 
 ~verification_context ()
 
void add_fact (PageID pid, int16_t level, bool high, size_t key_len, const char *key)
 
void add_fact (PageID pid, int16_t level, bool high, size_t prefix_len, const char *prefix, size_t suffix_len, const char *suffix)
 
void add_fact (PageID pid, int16_t level, bool high, const w_keystr_t &key)
 
void add_expectation (PageID pid, int16_t level, bool high, size_t key_len, const char *key)
 
void add_expectation (PageID pid, int16_t level, bool high, size_t prefix_len, const char *prefix, size_t suffix_len, const char *suffix)
 
void add_expectation (PageID pid, int16_t level, bool high, const w_keystr_t &key)
 
bool is_bitmap_clean () const
 

Public Attributes

char * _bitmap
 
int _bitmap_size
 
const int _hash_bits
 
int _pages_checked
 
int _pages_inconsistent
 

Private Member Functions

 verification_context ()
 
 verification_context (const verification_context &)
 

Static Private Member Functions

static uint32_t _modify_hash (const char *data, size_t len, uint32_t hash_value)
 
static uint32_t _modify_hash (uint32_t data, uint32_t hash_value)
 

Detailed Description

The context object maintained throughout the verification.

This object is used only for batch (in-detail) verification. For in-page verification, this isn't required.

Constructor & Destructor Documentation

§ verification_context() [1/3]

verification_context::verification_context ( int  hash_bits)

§ ~verification_context()

verification_context::~verification_context ( )

§ verification_context() [2/3]

verification_context::verification_context ( )
private

§ verification_context() [3/3]

verification_context::verification_context ( const verification_context )
private

Member Function Documentation

§ _modify_hash() [1/2]

uint32_t verification_context::_modify_hash ( const char *  data,
size_t  len,
uint32_t  hash_value 
)
staticprivate

§ _modify_hash() [2/2]

uint32_t verification_context::_modify_hash ( uint32_t  data,
uint32_t  hash_value 
)
staticprivate

§ add_expectation() [1/3]

void verification_context::add_expectation ( PageID  pid,
int16_t  level,
bool  high,
size_t  key_len,
const char *  key 
)
inline

same as add_fact(), but has different function name to make the code more readable.

§ add_expectation() [2/3]

void verification_context::add_expectation ( PageID  pid,
int16_t  level,
bool  high,
size_t  prefix_len,
const char *  prefix,
size_t  suffix_len,
const char *  suffix 
)

for the case the string consists of two parts (prefix and suffix).

§ add_expectation() [3/3]

void verification_context::add_expectation ( PageID  pid,
int16_t  level,
bool  high,
const w_keystr_t key 
)
inline

overload for w_keystr_t.

§ add_fact() [1/3]

void verification_context::add_fact ( PageID  pid,
int16_t  level,
bool  high,
size_t  key_len,
const char *  key 
)
inline

flips a bit corresponding to the specified fact.

§ add_fact() [2/3]

void verification_context::add_fact ( PageID  pid,
int16_t  level,
bool  high,
size_t  prefix_len,
const char *  prefix,
size_t  suffix_len,
const char *  suffix 
)

for the case the string consists of two parts (prefix and suffix).

§ add_fact() [3/3]

void verification_context::add_fact ( PageID  pid,
int16_t  level,
bool  high,
const w_keystr_t key 
)
inline

overload for w_keystr_t.

§ is_bitmap_clean()

bool verification_context::is_bitmap_clean ( ) const

Returns if all bitmap entries are zero, implying that the BTree is consistent.

Member Data Documentation

§ _bitmap

char* verification_context::_bitmap

bitmap to be flipped for each fact we collect.

§ _bitmap_size

int verification_context::_bitmap_size

byte length of _bitmap. should be multiply of 8 to make checking efficient.

§ _hash_bits

const int verification_context::_hash_bits

the number of bits we use for hashing.

§ _pages_checked

int verification_context::_pages_checked

count of pages checked so far, for reporting purpose only.

§ _pages_inconsistent

int verification_context::_pages_inconsistent

count of pages that had in-page inconsistency.


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