diff options
| author | Dan Engelbrecht <[email protected]> | 2024-03-14 16:50:18 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-03-14 16:50:18 +0100 |
| commit | 0a935231009cb21680d364ef125f0296a5a5bed6 (patch) | |
| tree | 7e55a67ae60883b0eab71a0d636aeec23f307d14 /src/zenutil/basicfile.cpp | |
| parent | clean up test linking (#4) (diff) | |
| download | zen-0a935231009cb21680d364ef125f0296a5a5bed6.tar.xz zen-0a935231009cb21680d364ef125f0296a5a5bed6.zip | |
special treatment large oplog attachments v2 (#5)
- Bugfix: Install Ctrl+C handler earlier when doing `zen oplog-export` and `zen oplog-export` to properly cancel jobs
- Improvement: Add ability to block a set of CAS entries from GC in project store
- Improvement: Large attachments and loose files are now split into smaller chunks and stored in blocks during oplog export
Diffstat (limited to 'src/zenutil/basicfile.cpp')
| -rw-r--r-- | src/zenutil/basicfile.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/zenutil/basicfile.cpp b/src/zenutil/basicfile.cpp index ad98bf652..f553fe5a0 100644 --- a/src/zenutil/basicfile.cpp +++ b/src/zenutil/basicfile.cpp @@ -272,7 +272,7 @@ BasicFile::Write(CompositeBuffer Data, uint64_t FileOffset, std::error_code& Ec) for (const SharedBuffer& Buffer : Data.GetSegments()) { MemoryView BlockView = Buffer.GetView(); - Write(BlockView, FileOffset, Ec); + Write(BlockView, FileOffset + WrittenBytes, Ec); if (Ec) { @@ -490,6 +490,14 @@ BasicFile::SetFileSize(uint64_t FileSize) #endif } +void +BasicFile::Attach(void* Handle) +{ + ZEN_ASSERT(Handle != nullptr); + ZEN_ASSERT(m_FileHandle == nullptr); + m_FileHandle = Handle; +} + void* BasicFile::Detach() { @@ -716,7 +724,7 @@ BasicFileWriter::~BasicFileWriter() } void -BasicFileWriter::Write(void* Data, uint64_t Size, uint64_t FileOffset) +BasicFileWriter::Write(const void* Data, uint64_t Size, uint64_t FileOffset) { if (m_Buffer == nullptr || (Size >= m_BufferSize)) { |