1 #ifndef __LOGARCHIVER_H 2 #define __LOGARCHIVER_H 16 #define BOOST_FILESYSTEM_NO_DEPRECATED 18 #include <boost/filesystem.hpp> 20 namespace fs = boost::filesystem;
71 return w_heap.NumElements();
107 os <<
"[run " << e.
run <<
", " << e.
pid <<
", " << e.
lsn <<
143 std::shared_ptr<ArchiveIndex> in,
144 std::shared_ptr<ArchiveIndex> ou =
nullptr);
148 virtual void do_work();
150 rc_t doMerge(
unsigned level,
unsigned fanin);
153 std::shared_ptr<ArchiveIndex>
indir;
244 bool requestFlushAsync(
lsn_t);
246 void requestFlushSync(
lsn_t);
248 void archiveUntilLSN(
lsn_t);
255 return consumer->getNextLSN();
271 const static bool DFT_EAGER =
true;
273 const static bool DFT_READ_WHOLE_BLOCKS =
true;
275 const static int DFT_GRACE_PERIOD = 1000000;
278 std::shared_ptr<ArchiveIndex>
index;
308 void pushIntoHeap(
logrec_t*,
bool duplicate);
310 bool waitForActivation();
312 bool processFlushRequest();
316 bool shouldActivate(
bool logTooSlow);
319 #endif // __LOGARCHIVER_H Definition: mem_mgmt.h:32
void atomic_thread_fence(memory_order order)
Definition: AtomicCounter.hpp:223
virtual ~ArchiverHeap()
Definition: logarchiver.cpp:175
Parses log records from a stream of binary data.
Definition: log_consumer.h:33
Definition: worker_thread.h:12
BlockAssembly * blkAssemb
Definition: logarchiver.h:284
size_t size()
Definition: logarchiver.h:70
lsn_t lsn
Definition: logarchiver.h:86
bool selfManaged
Definition: logarchiver.h:292
int slowLogGracePeriod
Definition: logarchiver.h:298
friend std::ostream & operator<<(std::ostream &os, const HeapEntry &e)
Definition: logarchiver.h:105
ArchiverControl control
Definition: logarchiver.h:290
bool readWholeBlocks
Definition: logarchiver.h:296
run_number_t run
Definition: logarchiver.h:88
lsn_t getNextConsumedLSN()
Definition: logarchiver.h:254
HeapEntry(run_number_t run, PageID pid, lsn_t lsn, fixed_lists_mem_t::slot_t slot)
Definition: logarchiver.h:92
HeapEntry()
Definition: logarchiver.h:99
Definition: thread_wrapper.h:16
virtual ~MergerDaemon()
Definition: logarchiver.h:146
fixed_lists_mem_t::slot_t slot
Definition: logarchiver.h:84
void pop()
Definition: logarchiver.cpp:266
std::atomic< bool > shutdownFlag
Definition: logarchiver.h:288
bool filledFirst
Definition: logarchiver.h:77
Start-up parameters for the storage engine. See OPTIONS.
Definition: sm_options.h:24
Definition: sm_base.h:240
static const lsn_t null
Definition: lsn.h:371
logrec_t * top()
Definition: logarchiver.cpp:282
int32_t run_number_t
Definition: basics.h:50
Component that consumes a partially-sorted log record stream and generates indexed runs from it...
Definition: logarchive_writer.h:95
fixed_lists_mem_t::slot_t allocate(size_t length)
Definition: logarchiver.cpp:179
Encapsulates all file and I/O operations on the log archive.
Definition: logarchive_index.h:94
ArchiverHeap(size_t workspaceSize)
Definition: logarchiver.cpp:168
Represents a transactional log record.
Definition: logrec.h:143
lsn_t flushReqLSN
Definition: logarchiver.h:302
MergerDaemon * merger
Definition: logarchiver.h:286
Definition: logarchiver.h:83
uint32_t PageID
Definition: basics.h:45
std::shared_ptr< ArchiveIndex > indir
Definition: logarchiver.h:153
General-purpose heap.
Definition: w_heap.h:78
Definition: logarchiver.h:113
Log Sequence Number. See Log Sequence Numbers (LSN).
Definition: lsn.h:243
lsn_t nextActLSN
Definition: logarchiver.h:300
void setEager(bool e)
Definition: logarchiver.h:258
fixed_lists_mem_t * workspace
Definition: logarchiver.h:79
bool _compression
Definition: logarchiver.h:159
Return code for most functions and methods.
Definition: w_rc.h:87
std::shared_ptr< ArchiveIndex > index
Definition: logarchiver.h:278
Cmp heapCmp
Definition: logarchiver.h:117
ArchiverHeap * heap
Definition: logarchiver.h:282
Heap< HeapEntry, Cmp > w_heap
Definition: logarchiver.h:119
Object to control execution of background threads.
Definition: log_consumer.h:134
char * address
Definition: mem_mgmt.h:33
std::shared_ptr< ArchiveIndex > getIndex()
Definition: logarchiver.h:250
PageID pid
Definition: logarchiver.h:90
run_number_t currentRun
Definition: logarchiver.h:75
Definition: AtomicCounter.hpp:114
Definition: logarchiver.h:140
bool getEager() const
Definition: logarchiver.h:263
Implementation of a log archiver using asynchronous reader and writer threads.
Definition: logarchiver.h:225
unsigned _fanin
Definition: logarchiver.h:157
bool eager
Definition: logarchiver.h:294
Provides a record-at-a-time interface to the recovery log using asynchronous read operations...
Definition: log_consumer.h:215
std::shared_ptr< ArchiveIndex > outdir
Definition: logarchiver.h:155
Heap data structure that supports log archive run generation.
Definition: logarchiver.h:54
LogConsumer * consumer
Definition: logarchiver.h:280
bool push(logrec_t *lr, bool duplicate)
Definition: logarchiver.cpp:198
size_t length
Definition: mem_mgmt.h:35
run_number_t topRun()
Definition: logarchiver.h:66
Definition: mem_mgmt.h:30