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

#include <bf_tree_cleaner.h>

Inheritance diagram for bf_tree_cleaner:
page_cleaner_base worker_thread_t thread_wrapper_t

Public Member Functions

 bf_tree_cleaner (const sm_options &_options)
 Constructor for bf_tree_cleaner. More...
 
 ~bf_tree_cleaner ()
 
- Public Member Functions inherited from page_cleaner_base
 page_cleaner_base (const sm_options &_options)
 
virtual ~page_cleaner_base ()
 
virtual void notify_archived_lsn (lsn_t)
 
- 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 ()
 

Protected Member Functions

virtual void do_work ()
 
policy_predicate_t get_policy_predicate (cleaner_policy p)
 
bool ignore_min_write_now () const
 
- Protected Member Functions inherited from page_cleaner_base
void write_pages (size_t from, size_t to)
 
void mark_pages_clean (size_t from, size_t to)
 
- Protected Member Functions inherited from worker_thread_t
bool should_exit () const
 
void notify_one ()
 
void notify_all ()
 
void quit ()
 

Private Member Functions

void collect_candidates ()
 
void clean_candidates ()
 
void flush_clusters (const vector< size_t > &clusters)
 
bool latch_and_copy (PageID, bf_idx, size_t wpos)
 
void clean_no_policy ()
 
void flush_workspace_no_clusters (size_t count)
 

Private Attributes

vector< cleaner_cb_infocandidates
 
size_t num_candidates
 Cleaner policy options. More...
 
cleaner_policy policy
 
size_t min_write_size
 Only write out clusters of pages with this minimum size. More...
 
size_t min_write_ignore_freq
 

Additional Inherited Members

- Protected Attributes inherited from page_cleaner_base
zero::buffer_pool::BufferPool_bufferpool
 
vector< generic_page, memalign_allocator< generic_page > > _workspace
 
size_t _workspace_size
 
vector< bf_idx_workspace_cb_indexes
 
lsn_t _clean_lsn
 
bool _write_elision
 

Constructor & Destructor Documentation

§ bf_tree_cleaner()

bf_tree_cleaner::bf_tree_cleaner ( const sm_options _options)

Constructor for bf_tree_cleaner.

This merely allocates arrays and objects. The real start-up is done in do_work() because a constructor can't return error codes.

Parameters
_optionsContains the set cleaner policy and options with regard to the selection of pages to clean.

§ ~bf_tree_cleaner()

bf_tree_cleaner::~bf_tree_cleaner ( )

Destructs this object. This merely de-allocates arrays and objects. Use request_stop_cleaners() or kill_cleaners() to stop cleaner threads.

Member Function Documentation

§ clean_candidates()

void bf_tree_cleaner::clean_candidates ( )
private

§ clean_no_policy()

void bf_tree_cleaner::clean_no_policy ( )
private

§ collect_candidates()

void bf_tree_cleaner::collect_candidates ( )
private

§ do_work()

void bf_tree_cleaner::do_work ( )
protectedvirtual

Actual working method to be implemented by derived classes.

Implements worker_thread_t.

§ flush_clusters()

void bf_tree_cleaner::flush_clusters ( const vector< size_t > &  clusters)
private

§ flush_workspace_no_clusters()

void bf_tree_cleaner::flush_workspace_no_clusters ( size_t  count)
private

§ get_policy_predicate()

policy_predicate_t bf_tree_cleaner::get_policy_predicate ( cleaner_policy  p)
protected

Return predicate function object that implements given policy

§ ignore_min_write_now()

bool bf_tree_cleaner::ignore_min_write_now ( ) const
inlineprotected

§ latch_and_copy()

bool bf_tree_cleaner::latch_and_copy ( PageID  pid,
bf_idx  idx,
size_t  wpos 
)
private

Member Data Documentation

§ candidates

vector<cleaner_cb_info> bf_tree_cleaner::candidates
private

List of candidate dirty frames to be considered for cleaning.

§ min_write_ignore_freq

size_t bf_tree_cleaner::min_write_ignore_freq
private

§ min_write_size

size_t bf_tree_cleaner::min_write_size
private

Only write out clusters of pages with this minimum size.

§ num_candidates

size_t bf_tree_cleaner::num_candidates
private

Cleaner policy options.

§ policy

cleaner_policy bf_tree_cleaner::policy
private

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