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

#include <logarchiver.h>

Inheritance diagram for MergerDaemon:
worker_thread_t thread_wrapper_t

Public Member Functions

 MergerDaemon (const sm_options &, std::shared_ptr< ArchiveIndex > in, std::shared_ptr< ArchiveIndex > ou=nullptr)
 
virtual ~MergerDaemon ()
 
virtual void do_work ()
 
rc_t doMerge (unsigned level, unsigned fanin)
 
- Public Member Functions inherited from worker_thread_t
 worker_thread_t (int inverval_ms=-1)
 
virtual ~worker_thread_t ()
 
void wakeup (bool wait=false, int rounds_to_wait=-1)
 
void stop ()
 
void wait_for_round (long round=0)
 
long get_rounds_completed () const
 
bool is_busy () const
 
- Public Member Functions inherited from thread_wrapper_t
 thread_wrapper_t ()
 
virtual ~thread_wrapper_t ()
 
virtual void before_run ()
 
virtual void after_run ()
 
void spawn ()
 
void fork ()
 
void join ()
 

Private Attributes

std::shared_ptr< ArchiveIndexindir
 
std::shared_ptr< ArchiveIndexoutdir
 
unsigned _fanin
 
bool _compression
 

Additional Inherited Members

- Protected Member Functions inherited from worker_thread_t
bool should_exit () const
 
void notify_one ()
 
void notify_all ()
 
void quit ()
 

Detailed Description

Basic service to merge existing log archive runs into larger ones. Currently, the merge logic only supports the very limited use case of merging all N run files into a smaller n, depending on a given fan-in and size limits. Currently, it is used simply to run our restore experiments with different number of runs for the same log archive volume.

In a proper implementation, we have to support useful policies, with the restriction that only consecutive runs can be merged. The biggest limitation right now is that we reuse the logic of BlockAssembly, but its control logic – especially the coordination with the WriterThread – is quite restricted to the usual case of a consumption of log records from the standard recovery log, i.e., ascending LSNs and run numbers, startLSN coming from the existing run files, etc. We have to make that logic clever and more abstract; or simply don't reuse the BlockAssembly infrastructure.

Constructor & Destructor Documentation

§ MergerDaemon()

MergerDaemon::MergerDaemon ( const sm_options options,
std::shared_ptr< ArchiveIndex in,
std::shared_ptr< ArchiveIndex ou = nullptr 
)

§ ~MergerDaemon()

virtual MergerDaemon::~MergerDaemon ( )
inlinevirtual

Member Function Documentation

§ do_work()

void MergerDaemon::do_work ( )
virtual

Actual working method to be implemented by derived classes.

Implements worker_thread_t.

§ doMerge()

rc_t MergerDaemon::doMerge ( unsigned  level,
unsigned  fanin 
)

Member Data Documentation

§ _compression

bool MergerDaemon::_compression
private

§ _fanin

unsigned MergerDaemon::_fanin
private

§ indir

std::shared_ptr<ArchiveIndex> MergerDaemon::indir
private

§ outdir

std::shared_ptr<ArchiveIndex> MergerDaemon::outdir
private

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