![]() |
The Gaudi Framework
v41r0 (bdbe7744)
|
#include </builds/gaudi/Gaudi/GaudiUtils/include/Gaudi/NTuple/DiskBuffer.h>

Public Member Functions | |
| Writer (std::filesystem::path path, std::string_view header, int zstdLevel=0, std::size_t blockSize=64 *1024) | |
| Create (truncating) path and write the preamble and header. | |
| ~Writer () | |
| Writer (const Writer &)=delete | |
| Writer & | operator= (const Writer &)=delete |
| void | beginRecord () |
| void | append (const void *data, std::size_t bytes) |
| void | endRecord () |
| void | close () |
| Flush and close; throws on failure. Safe to call twice. | |
| std::uint64_t | entries () const |
| Records written to the file; records lost to a failed flush do not count. | |
| std::uint64_t | bytes () const |
| Payload bytes of those records. | |
| std::uint64_t | storedBytes () const |
| Bytes written to the file after the header. | |
| int | zstdLevel () const |
| std::size_t | blockSize () const |
| const std::filesystem::path & | path () const |
Private Member Functions | |
| void | flush () |
| void | write (const void *data, std::size_t bytes) |
Private Attributes | |
| std::filesystem::path | m_path |
| FileHandle | m_file |
| int | m_level |
| std::size_t | m_blockSize |
| std::vector< char > | m_buf |
| std::size_t | m_recordStart { 0 } |
| bool | m_inRecord { false } |
| std::uint64_t | m_entries { 0 } |
| std::uint64_t | m_bytes { 0 } |
| std::uint64_t | m_stored { 0 } |
| std::uint64_t | m_pending { 0 } |
| std::uint64_t | m_pendingBytes { 0 } |
Definition at line 61 of file DiskBuffer.h.
| Writer::Writer | ( | std::filesystem::path | path, |
| std::string_view | header, | ||
| int | zstdLevel = 0, | ||
| std::size_t | blockSize = 64 * 1024 ) |
Create (truncating) path and write the preamble and header.
zstdLevel 0 stores the blocks as they are; anything else needs zstdAvailable(). A block is written once blockSize bytes of records have accumulated, so that is the memory held per open file and what zstd sees at a time.
Definition at line 63 of file NTupleDiskBuffer.cpp.
|
default |
|
delete |
| void Writer::append | ( | const void * | data, |
| std::size_t | bytes ) |
Definition at line 93 of file NTupleDiskBuffer.cpp.
| void Writer::beginRecord | ( | ) |
Definition at line 86 of file NTupleDiskBuffer.cpp.
|
inline |
Definition at line 86 of file DiskBuffer.h.
|
inline |
| void Writer::close | ( | ) |
Flush and close; throws on failure. Safe to call twice.
Definition at line 162 of file NTupleDiskBuffer.cpp.
| void Writer::endRecord | ( | ) |
Definition at line 102 of file NTupleDiskBuffer.cpp.
|
inline |
Records written to the file; records lost to a failed flush do not count.
Definition at line 80 of file DiskBuffer.h.
|
private |
Definition at line 118 of file NTupleDiskBuffer.cpp.
|
inline |
Definition at line 87 of file DiskBuffer.h.
|
inline |
|
private |
|
inline |
Definition at line 85 of file DiskBuffer.h.
|
private |
Definition at line 96 of file DiskBuffer.h.
|
private |
Definition at line 97 of file DiskBuffer.h.
|
private |
Definition at line 101 of file DiskBuffer.h.
|
private |
Definition at line 100 of file DiskBuffer.h.
|
private |
Definition at line 94 of file DiskBuffer.h.
|
private |
Definition at line 99 of file DiskBuffer.h.
|
private |
Definition at line 95 of file DiskBuffer.h.
|
private |
Definition at line 93 of file DiskBuffer.h.
|
private |
Definition at line 103 of file DiskBuffer.h.
|
private |
Definition at line 104 of file DiskBuffer.h.
|
private |
Definition at line 98 of file DiskBuffer.h.
|
private |
Definition at line 102 of file DiskBuffer.h.