Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple Struct Reference

Definition at line 127 of file RMiniFile.hxx.

Public Member Functions

 RFileSimple ()
 
 RFileSimple (const RFileSimple &other)=delete
 
 RFileSimple (RFileSimple &&other)=delete
 
 ~RFileSimple ()
 
void AllocateBuffers (std::size_t bufferSize)
 
void Flush ()
 
 operator bool () const
 
RFileSimpleoperator= (const RFileSimple &other)=delete
 
RFileSimpleoperator= (RFileSimple &&other)=delete
 
std::uint64_t ReserveBlobKey (std::size_t nbytes, std::size_t len, unsigned char keyBuffer[kBlobKeyLen]=nullptr)
 Reserves an RBlob opaque key as data record and returns the offset of the record.
 
void Write (const void *buffer, size_t nbytes, std::int64_t offset=-1)
 Writes bytes in the open stream, either at fFilePos or at the given offset.
 
std::uint64_t WriteKey (const void *buffer, std::size_t nbytes, std::size_t len, std::int64_t offset=-1, std::uint64_t directoryOffset=100, const std::string &className="", const std::string &objectName="", const std::string &title="")
 Writes a TKey including the data record, given by buffer, into fFile; returns the file offset to the payload.
 

Public Attributes

unsigned char * fBlock = nullptr
 
std::uint64_t fBlockOffset = 0
 
std::size_t fBlockSize = 0
 
std::unique_ptr< ROOT::Experimental::Internal::RTFileControlBlockfControlBlock
 Keeps track of TFile control structures, which need to be updated on committing the data set.
 
bool fDirectIO = false
 Whether the C file stream has been opened with Direct I/O, introducing alignment requirements.
 
FILE * fFile = nullptr
 For the simplest cases, a C file stream can be used for writing.
 
std::uint64_t fFilePos = 0
 Keeps track of the seek offset.
 
unsigned char * fHeaderBlock = nullptr
 
std::uint64_t fKeyOffset = 0
 Keeps track of the next key offset.
 

Static Public Attributes

static constexpr int kBlockAlign = 4096
 Direct I/O requires that all buffers and write lengths are aligned.
 
static constexpr std::size_t kHeaderBlockSize = 4096
 During commit, WriteTFileKeysList() updates fNBytesKeys and fSeekKeys of the RTFFile located at fSeekFileRecord.
 

Constructor & Destructor Documentation

◆ RFileSimple() [1/3]

ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::RFileSimple ( )
default

◆ RFileSimple() [2/3]

ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::RFileSimple ( const RFileSimple other)
delete

◆ RFileSimple() [3/3]

ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::RFileSimple ( RFileSimple &&  other)
delete

◆ ~RFileSimple()

ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::~RFileSimple ( )

Definition at line 917 of file RMiniFile.cxx.

Member Function Documentation

◆ AllocateBuffers()

void ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::AllocateBuffers ( std::size_t  bufferSize)

Definition at line 903 of file RMiniFile.cxx.

◆ Flush()

void ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::Flush ( )

Definition at line 940 of file RMiniFile.cxx.

◆ operator bool()

ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::operator bool ( ) const
inline

Definition at line 175 of file RMiniFile.hxx.

◆ operator=() [1/2]

RFileSimple & ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::operator= ( const RFileSimple other)
delete

◆ operator=() [2/2]

RFileSimple & ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::operator= ( RFileSimple &&  other)
delete

◆ ReserveBlobKey()

std::uint64_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::ReserveBlobKey ( std::size_t  nbytes,
std::size_t  len,
unsigned char  keyBuffer[kBlobKeyLen] = nullptr 
)

Reserves an RBlob opaque key as data record and returns the offset of the record.

If keyBuffer is specified, it must be written before the returned offset. (Note that the array type is purely documentation, the argument is actually just a pointer.)

Definition at line 1058 of file RMiniFile.cxx.

◆ Write()

void ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::Write ( const void *  buffer,
size_t  nbytes,
std::int64_t  offset = -1 
)

Writes bytes in the open stream, either at fFilePos or at the given offset.

Definition at line 984 of file RMiniFile.cxx.

◆ WriteKey()

std::uint64_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::WriteKey ( const void *  buffer,
std::size_t  nbytes,
std::size_t  len,
std::int64_t  offset = -1,
std::uint64_t  directoryOffset = 100,
const std::string &  className = "",
const std::string &  objectName = "",
const std::string &  title = "" 
)

Writes a TKey including the data record, given by buffer, into fFile; returns the file offset to the payload.

The payload is already compressed

Definition at line 1033 of file RMiniFile.cxx.

Member Data Documentation

◆ fBlock

unsigned char* ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fBlock = nullptr

Definition at line 141 of file RMiniFile.hxx.

◆ fBlockOffset

std::uint64_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fBlockOffset = 0

Definition at line 140 of file RMiniFile.hxx.

◆ fBlockSize

std::size_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fBlockSize = 0

Definition at line 139 of file RMiniFile.hxx.

◆ fControlBlock

std::unique_ptr<ROOT::Experimental::Internal::RTFileControlBlock> ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fControlBlock

Keeps track of TFile control structures, which need to be updated on committing the data set.

Definition at line 152 of file RMiniFile.hxx.

◆ fDirectIO

bool ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fDirectIO = false

Whether the C file stream has been opened with Direct I/O, introducing alignment requirements.

Definition at line 146 of file RMiniFile.hxx.

◆ fFile

FILE* ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fFile = nullptr

For the simplest cases, a C file stream can be used for writing.

Definition at line 144 of file RMiniFile.hxx.

◆ fFilePos

std::uint64_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fFilePos = 0

Keeps track of the seek offset.

Definition at line 148 of file RMiniFile.hxx.

◆ fHeaderBlock

unsigned char* ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fHeaderBlock = nullptr

Definition at line 138 of file RMiniFile.hxx.

◆ fKeyOffset

std::uint64_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fKeyOffset = 0

Keeps track of the next key offset.

Definition at line 150 of file RMiniFile.hxx.

◆ kBlockAlign

constexpr int ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::kBlockAlign = 4096
staticconstexpr

Direct I/O requires that all buffers and write lengths are aligned.

It seems 512 byte alignment is the minimum for Direct I/O to work, but further testing showed that it results in worse performance than 4kB.

Definition at line 130 of file RMiniFile.hxx.

◆ kHeaderBlockSize

constexpr std::size_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::kHeaderBlockSize = 4096
staticconstexpr

During commit, WriteTFileKeysList() updates fNBytesKeys and fSeekKeys of the RTFFile located at fSeekFileRecord.

Given that the TFile key starts at offset 100 and the file name, which is written twice, is shorter than 255 characters, we should need at most ~600 bytes. However, the header also needs to be aligned to kBlockAlign...

Definition at line 135 of file RMiniFile.hxx.

Collaboration diagram for ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple:
[legend]

The documentation for this struct was generated from the following files: