diff options
| author | Dan Engelbrecht <[email protected]> | 2022-04-04 12:05:25 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-04-04 12:05:25 +0200 |
| commit | 605b4f330eed43b14135f37ffb58c14fa1cd79c2 (patch) | |
| tree | e8c99f26abb0634ecf53afe76cebd6f0c05742ca /zenstore/include | |
| parent | logging cleanup (diff) | |
| download | zen-605b4f330eed43b14135f37ffb58c14fa1cd79c2.tar.xz zen-605b4f330eed43b14135f37ffb58c14fa1cd79c2.zip | |
always keep full log but read from index snapshot location if available
Diffstat (limited to 'zenstore/include')
| -rw-r--r-- | zenstore/include/zenstore/caslog.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/zenstore/include/zenstore/caslog.h b/zenstore/include/zenstore/caslog.h index d09f4befb..4b93a708f 100644 --- a/zenstore/include/zenstore/caslog.h +++ b/zenstore/include/zenstore/caslog.h @@ -24,7 +24,7 @@ public: void Open(std::filesystem::path FileName, size_t RecordSize, Mode Mode); void Append(const void* DataPointer, uint64_t DataSize); - void Replay(std::function<void(const void*)>&& Handler); + void Replay(std::function<void(const void*)>&& Handler, uint64_t SkipEntryCount); void Flush(); void Close(); uint64_t GetLogSize(); @@ -66,13 +66,15 @@ public: // This should be called before the Replay() is called to do some basic sanity checking bool Initialize() { return true; } - void Replay(Invocable<const T&> auto Handler) + void Replay(Invocable<const T&> auto Handler, uint64_t SkipEntryCount) { - CasLogFile::Replay([&](const void* VoidPtr) { - const T& Record = *reinterpret_cast<const T*>(VoidPtr); + CasLogFile::Replay( + [&](const void* VoidPtr) { + const T& Record = *reinterpret_cast<const T*>(VoidPtr); - Handler(Record); - }); + Handler(Record); + }, + SkipEntryCount); } void Append(const T& Record) |