The Gaudi Framework  master (2e57474e)
Loading...
Searching...
No Matches
Gaudi::NTuple::DiskBuffer Namespace Reference

Append-only file of length-prefixed records, used to park ntuple rows on disk during the event loop and replay them at finalize. More...

Namespaces

namespace  details

Classes

class  Error
 Any I/O or format problem, carrying the file it happened on. More...
class  Writer
class  Reader

Typedefs

using FileHandle = std::unique_ptr<std::FILE, details::Close>
 Owns an open file; close() is the checked path, this is the fallback.

Functions

bool zstdAvailable ()
 Whether this build can write and read compressed blocks.
std::size_t maxBlockSize ()
 Largest block size a Writer accepts.

Detailed Description

Append-only file of length-prefixed records, used to park ntuple rows on disk during the event loop and replay them at finalize.

Layout: 8-byte magic, uint32 byte-order mark, uint32 format version, uint32 compression (0 none, 1 zstd), uint32 header length, header bytes (opaque to this class), then blocks of uint32 stored length | uint32 raw length | bytes until end of file. A block holds whole records, uint32 length | payload each, and is one zstd frame when compression is on. Nothing here knows what a row is; the caller decides.

Typedef Documentation

◆ FileHandle

using Gaudi::NTuple::DiskBuffer::FileHandle = std::unique_ptr<std::FILE, details::Close>

Owns an open file; close() is the checked path, this is the fallback.

Definition at line 47 of file DiskBuffer.h.

Function Documentation

◆ maxBlockSize()

std::size_t Gaudi::NTuple::DiskBuffer::maxBlockSize ( )

Largest block size a Writer accepts.

Definition at line 46 of file NTupleDiskBuffer.cpp.

46{ return MAX_BLOCK; }

◆ zstdAvailable()

bool Gaudi::NTuple::DiskBuffer::zstdAvailable ( )

Whether this build can write and read compressed blocks.

Definition at line 48 of file NTupleDiskBuffer.cpp.

48 {
49#ifdef GAUDI_USE_ZSTD
50 return true;
51#else
52 return false;
53#endif
54}