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

Heap data structure that supports log archive run generation. More...

#include <logarchiver.h>

Classes

struct  Cmp
 
struct  HeapEntry
 

Public Member Functions

 ArchiverHeap (size_t workspaceSize)
 
virtual ~ArchiverHeap ()
 
bool push (logrec_t *lr, bool duplicate)
 
logrec_ttop ()
 
void pop ()
 
run_number_t topRun ()
 
size_t size ()
 

Private Member Functions

fixed_lists_mem_t::slot_t allocate (size_t length)
 

Private Attributes

run_number_t currentRun
 
bool filledFirst
 
fixed_lists_mem_tworkspace
 
Cmp heapCmp
 
Heap< HeapEntry, Cmpw_heap
 

Detailed Description

Heap data structure that supports log archive run generation.

This class encapsulates a heap data structure in a way which is transparent to the replacement-selection logic of the enclosing LogArchiver instance. It contains a heap data structure as well as a memory manager for the variable-length log records.

The heap contains instances of HeapEntry, which contains the sort key of log records (run number, page id, lsn) and a pointer to the log record data in the memory manager workspace (slot_t).

This class is more than just a heap data structure because it is aware of run boundaries. Therefore, it can be seen as a replacement-selection module, with the particularity that records are not delayed to future runs, in order to maintain a fixed mapping from regions of the recovery log (i.e., LSN ranges) to runs in the log archive. The goal of such mapping is to facilitate the resume of log archiving after a system failure (see our BTW 2015 paper on Single-Pass Restore for more details).

This class participates in the log archiving pipeline in which the input stream of log records coming from the log consumer is fed into the heap by invoking push() for each log record. This is analogous to the replacement step of the sorting algorithm. On the other side, the selection step pops log records out of the heap and feeds them to the BlockAssembly component.

Author
Caetano Sauer

Constructor & Destructor Documentation

§ ArchiverHeap()

ArchiverHeap::ArchiverHeap ( size_t  workspaceSize)

§ ~ArchiverHeap()

ArchiverHeap::~ArchiverHeap ( )
virtual

Member Function Documentation

§ allocate()

slot_t ArchiverHeap::allocate ( size_t  length)
private

§ pop()

void ArchiverHeap::pop ( )

§ push()

bool ArchiverHeap::push ( logrec_t lr,
bool  duplicate 
)

§ size()

size_t ArchiverHeap::size ( )
inline

§ top()

logrec_t * ArchiverHeap::top ( )

§ topRun()

run_number_t ArchiverHeap::topRun ( )
inline

Member Data Documentation

§ currentRun

run_number_t ArchiverHeap::currentRun
private

§ filledFirst

bool ArchiverHeap::filledFirst
private

§ heapCmp

Cmp ArchiverHeap::heapCmp
private

§ w_heap

Heap<HeapEntry, Cmp> ArchiverHeap::w_heap
private

§ workspace

fixed_lists_mem_t* ArchiverHeap::workspace
private

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