Zero  0.1.0
Public Types | Public Member Functions | Protected Attributes | List of all members
RestoreBitmap Class Reference

Bitmap data structure that controls the progress of restore. More...

#include <restore.h>

Public Types

enum  State { State::UNRESTORED = 0, State::RESTORING = 1, State::RESTORED = 2 }
 

Public Member Functions

 RestoreBitmap (size_t size)
 
 ~RestoreBitmap ()
 
size_t get_size ()
 
bool is_unrestored (unsigned i) const
 
bool is_restoring (unsigned i) const
 
bool is_restored (unsigned i) const
 
bool attempt_restore (unsigned i)
 
void mark_restored (unsigned i)
 
unsigned get_first_unrestored () const
 
unsigned get_first_restoring () const
 

Protected Attributes

std::atomic< State > * states
 
const size_t _size
 

Detailed Description

Bitmap data structure that controls the progress of restore.

The bitmap contains one bit for each segment of the failed volume. All bits are initially "false", and a bit is set to "true" when the corresponding segment has been restored. This class is completely oblivious to pages inside a segment – it is the callers resposibility to interpret what a segment consists of.

Member Enumeration Documentation

§ State

enum RestoreBitmap::State
strong
Enumerator
UNRESTORED 
RESTORING 
RESTORED 

Constructor & Destructor Documentation

§ RestoreBitmap()

RestoreBitmap::RestoreBitmap ( size_t  size)
inline

§ ~RestoreBitmap()

RestoreBitmap::~RestoreBitmap ( )
inline

Member Function Documentation

§ attempt_restore()

bool RestoreBitmap::attempt_restore ( unsigned  i)
inline

§ get_first_restoring()

unsigned RestoreBitmap::get_first_restoring ( ) const
inline

§ get_first_unrestored()

unsigned RestoreBitmap::get_first_unrestored ( ) const
inline

§ get_size()

size_t RestoreBitmap::get_size ( )
inline

§ is_restored()

bool RestoreBitmap::is_restored ( unsigned  i) const
inline

§ is_restoring()

bool RestoreBitmap::is_restoring ( unsigned  i) const
inline

§ is_unrestored()

bool RestoreBitmap::is_unrestored ( unsigned  i) const
inline

§ mark_restored()

void RestoreBitmap::mark_restored ( unsigned  i)
inline

Member Data Documentation

§ _size

const size_t RestoreBitmap::_size
protected

§ states

std::atomic<State>* RestoreBitmap::states
protected

Get lowest false value and highest true value in order to compress serialized format. Such compression is effective in a single-pass or schedule. It is basically a run-length encoding, but supporting only a run of ones in the beginning and a run of zeroes in the end of the bitmap


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