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