diff options
| author | Dan Engelbrecht <[email protected]> | 2023-02-23 14:54:22 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-02-23 05:54:22 -0800 |
| commit | d361aa896e2e74ae4a790c4668c78c830f9b5d1c (patch) | |
| tree | c76518eaab8d4b6b0ba185bdec0fe07639729ea8 /zenstore/include | |
| parent | junit test reporting (#239) (diff) | |
| download | zen-d361aa896e2e74ae4a790c4668c78c830f9b5d1c.tar.xz zen-d361aa896e2e74ae4a790c4668c78c830f9b5d1c.zip | |
store cache rawhash and rawsize for unstructured cache values (#234)
* refactored MemoryCacheBucket to allow for storing RawHash/RawSize.
* remove redundant conversions in AccessTime
* reduce max count for memory cache bucket to 32-bit value
* refactored DiskCacheBucket to allow for storing RawHash/RawSize.
* Use CompressedBuffer::ValidateCompressedHeader when applicable
* Make sure we rewrite the snapshot if we read an legacy existing index/log
* changelog
Diffstat (limited to 'zenstore/include')
| -rw-r--r-- | zenstore/include/zenstore/caslog.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/zenstore/include/zenstore/caslog.h b/zenstore/include/zenstore/caslog.h index 1aeb50d05..d8c3f22f3 100644 --- a/zenstore/include/zenstore/caslog.h +++ b/zenstore/include/zenstore/caslog.h @@ -20,13 +20,14 @@ public: kTruncate }; - 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, uint64_t SkipEntryCount); - void Flush(); - void Close(); - uint64_t GetLogSize(); - uint64_t GetLogCount(); + static bool IsValid(std::filesystem::path FileName, size_t RecordSize); + 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, uint64_t SkipEntryCount); + void Flush(); + void Close(); + uint64_t GetLogSize(); + uint64_t GetLogCount(); private: struct FileHeader @@ -59,7 +60,8 @@ template<typename T> class TCasLogFile : public CasLogFile { public: - void Open(std::filesystem::path FileName, Mode Mode) { CasLogFile::Open(FileName, sizeof(T), Mode); } + static bool IsValid(std::filesystem::path FileName) { return CasLogFile::IsValid(FileName, sizeof(T)); } + void Open(std::filesystem::path FileName, Mode Mode) { CasLogFile::Open(FileName, sizeof(T), Mode); } // This should be called before the Replay() is called to do some basic sanity checking bool Initialize() { return true; } |