Zero  0.1.0
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
log_storage Class Reference

#include <log_storage.h>

Public Types

enum  { BLOCK_SIZE = partition_t::XFERSIZE }
 

Public Member Functions

 log_storage (const sm_options &)
 
virtual ~log_storage ()
 
shared_ptr< partition_tget_partition_for_flush (lsn_t start_lsn, long start1, long end1, long start2, long end2)
 
shared_ptr< partition_tcurr_partition () const
 
shared_ptr< partition_tget_partition (partition_number_t n) const
 
void list_partitions (std::vector< partition_number_t > &vec) const
 
skip_logget_skip_log ()
 
off_t get_partition_size () const
 
size_t get_byte_distance (lsn_t a, lsn_t b) const
 
string make_log_name (partition_number_t pnum) const
 
fs::path make_log_path (partition_number_t pnum) const
 
fs::path make_chkpt_path (lsn_t lsn) const
 
void add_checkpoint (lsn_t lsn)
 
void wakeup_recycler (bool chkpt_only=false)
 
unsigned delete_old_partitions (bool chkpt_only=false, partition_number_t older_than=0)
 

Static Public Attributes

static const string log_prefix = "log."
 
static const string log_regex = "log\\.[1-9][0-9]*"
 
static const string chkpt_prefix = "chkpt_"
 
static const string chkpt_regex = "chkpt_[1-9][0-9]*\\.[0-9][0-9]*"
 

Private Member Functions

shared_ptr< partition_tcreate_partition (partition_number_t pnum)
 
 log_storage (const log_storage &)
 
log_storageoperator= (const log_storage &)
 
void try_delete (partition_number_t)
 

Private Attributes

fs::path _logpath
 
off_t _partition_size
 
partition_map_t _partitions
 
shared_ptr< partition_t_curr_partition
 
vector< lsn_t_checkpoints
 
skip_log_skip_log
 
unsigned _max_partitions
 
bool _delete_old_partitions
 
mcs_rwlock _partition_map_latch
 
unique_ptr< partition_recycler_t_recycler_thread
 

Friends

class partition_t
 
class partition_recycler_t
 

Member Enumeration Documentation

§ anonymous enum

anonymous enum
Enumerator
BLOCK_SIZE 

Constructor & Destructor Documentation

§ log_storage() [1/2]

log_storage::log_storage ( const sm_options options)

§ ~log_storage()

log_storage::~log_storage ( )
virtual

§ log_storage() [2/2]

log_storage::log_storage ( const log_storage )
private

Member Function Documentation

§ add_checkpoint()

void log_storage::add_checkpoint ( lsn_t  lsn)

§ create_partition()

shared_ptr< partition_t > log_storage::create_partition ( partition_number_t  pnum)
private

§ curr_partition()

shared_ptr< partition_t > log_storage::curr_partition ( ) const

§ delete_old_partitions()

unsigned log_storage::delete_old_partitions ( bool  chkpt_only = false,
partition_number_t  older_than = 0 
)

§ get_byte_distance()

size_t log_storage::get_byte_distance ( lsn_t  a,
lsn_t  b 
) const

§ get_partition()

shared_ptr< partition_t > log_storage::get_partition ( partition_number_t  n) const

§ get_partition_for_flush()

shared_ptr< partition_t > log_storage::get_partition_for_flush ( lsn_t  start_lsn,
long  start1,
long  end1,
long  start2,
long  end2 
)

§ get_partition_size()

off_t log_storage::get_partition_size ( ) const
inline

§ get_skip_log()

skip_log* log_storage::get_skip_log ( )
inline

§ list_partitions()

void log_storage::list_partitions ( std::vector< partition_number_t > &  vec) const

§ make_chkpt_path()

fs::path log_storage::make_chkpt_path ( lsn_t  lsn) const

§ make_log_name()

string log_storage::make_log_name ( partition_number_t  pnum) const

§ make_log_path()

fs::path log_storage::make_log_path ( partition_number_t  pnum) const

§ operator=()

log_storage& log_storage::operator= ( const log_storage )
private

§ try_delete()

void log_storage::try_delete ( partition_number_t  pnum)
private

§ wakeup_recycler()

void log_storage::wakeup_recycler ( bool  chkpt_only = false)

Friends And Related Function Documentation

§ partition_recycler_t

friend class partition_recycler_t
friend

§ partition_t

friend class partition_t
friend

Member Data Documentation

§ _checkpoints

vector<lsn_t> log_storage::_checkpoints
private

§ _curr_partition

shared_ptr<partition_t> log_storage::_curr_partition
private

§ _delete_old_partitions

bool log_storage::_delete_old_partitions
private

§ _logpath

fs::path log_storage::_logpath
private

§ _max_partitions

unsigned log_storage::_max_partitions
private

§ _partition_map_latch

mcs_rwlock log_storage::_partition_map_latch
mutableprivate

§ _partition_size

off_t log_storage::_partition_size
private

§ _partitions

partition_map_t log_storage::_partitions
private

§ _recycler_thread

unique_ptr<partition_recycler_t> log_storage::_recycler_thread
private

§ _skip_log

skip_log* log_storage::_skip_log
private

§ chkpt_prefix

const string log_storage::chkpt_prefix = "chkpt_"
static

§ chkpt_regex

const string log_storage::chkpt_regex = "chkpt_[1-9][0-9]*\\.[0-9][0-9]*"
static

§ log_prefix

const string log_storage::log_prefix = "log."
static

§ log_regex

const string log_storage::log_regex = "log\\.[1-9][0-9]*"
static

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