aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-09-05 18:53:44 -0400
committerGitHub <[email protected]>2023-09-06 00:53:44 +0200
commit832a1b464633ec7a31a8aad386520e1990d0b6cb (patch)
treea07ba97f28fbe90e5aac8ea5d086f687e7aa38bd /src/zencore/include
parentretry file create (#383) (diff)
downloadzen-832a1b464633ec7a31a8aad386520e1990d0b6cb.tar.xz
zen-832a1b464633ec7a31a8aad386520e1990d0b6cb.zip
stream oplog attachments from jupiter (#384)
* stream large downloads from jupiter to temporary file * rework DeleteOnClose - top level marks file for delete and if lower level parts wants to keep it it clears that flag * changelog * log number of attachments to download * add delay on jupiter request failure when retrying * make sure we upload all attachments even if Needs are empty when ForceUpload is true release TempAttachment as soon as it is used * sort attachments so we get predictable blocks for the same oplog
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/iobuffer.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/zencore/include/zencore/iobuffer.h b/src/zencore/include/zencore/iobuffer.h
index bbc346f9b..fef78741f 100644
--- a/src/zencore/include/zencore/iobuffer.h
+++ b/src/zencore/include/zencore/iobuffer.h
@@ -270,20 +270,20 @@ struct IoBufferExtendedCore : public IoBufferCore
enum ExtendedFlags
{
- kOwnsFile = 1 << 16,
- kOwnsMmap = 1 << 17
+ kOwnsFile = 1 << 16,
+ kOwnsMmap = 1 << 17,
+ kDeleteOnClose = 1 << 18
};
void Materialize() const;
bool GetFileReference(IoBufferFileReference& OutRef) const;
- void MarkAsDeleteOnClose();
+ void SetDeleteOnClose(bool DeleteOnClose);
private:
void* m_FileHandle = nullptr;
uint64_t m_FileOffset = 0;
mutable void* m_MmapHandle = nullptr;
mutable void* m_MappedPointer = nullptr;
- bool m_DeleteOnClose = false;
};
inline IoBufferExtendedCore*
@@ -362,7 +362,7 @@ public:
memcpy(const_cast<void*>(m_Core->DataPointer()), DataPtr, SizeBytes);
}
- ZENCORE_API IoBuffer(EFileTag, void* FileHandle, uint64_t ChunkFileOffset, uint64_t ChunkSize);
+ ZENCORE_API IoBuffer(EFileTag, void* FileHandle, uint64_t ChunkFileOffset, uint64_t ChunkSize, bool IsWholeFile);
ZENCORE_API IoBuffer(EBorrowedFileTag, void* FileHandle, uint64_t ChunkFileOffset, uint64_t ChunkSize);
inline explicit operator bool() const { return !m_Core->IsNull(); }
@@ -379,7 +379,7 @@ public:
inline void SetContentType(ZenContentType ContentType) { m_Core->SetContentType(ContentType); }
[[nodiscard]] inline ZenContentType GetContentType() const { return m_Core->GetContentType(); }
[[nodiscard]] ZENCORE_API bool GetFileReference(IoBufferFileReference& OutRef) const;
- void MarkAsDeleteOnClose();
+ void SetDeleteOnClose(bool DeleteOnClose);
inline MemoryView GetView() const { return MemoryView(m_Core->DataPointer(), m_Core->DataBytes()); }
inline MutableMemoryView GetMutableView() { return MutableMemoryView(m_Core->MutableDataPointer(), m_Core->DataBytes()); }