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 | |
RFileSimple & | operator= (const RFileSimple &other)=delete |
RFileSimple & | operator= (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::RTFileControlBlock > | fControlBlock |
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. | |
|
default |
|
delete |
|
delete |
ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::~RFileSimple | ( | ) |
Definition at line 914 of file RMiniFile.cxx.
void ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::AllocateBuffers | ( | std::size_t | bufferSize | ) |
Definition at line 900 of file RMiniFile.cxx.
void ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::Flush | ( | ) |
Definition at line 937 of file RMiniFile.cxx.
|
inline |
Definition at line 175 of file RMiniFile.hxx.
|
delete |
|
delete |
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 1055 of file RMiniFile.cxx.
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 981 of file RMiniFile.cxx.
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 1030 of file RMiniFile.cxx.
unsigned char* ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fBlock = nullptr |
Definition at line 141 of file RMiniFile.hxx.
std::uint64_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fBlockOffset = 0 |
Definition at line 140 of file RMiniFile.hxx.
std::size_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fBlockSize = 0 |
Definition at line 139 of file RMiniFile.hxx.
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.
Whether the C file stream has been opened with Direct I/O, introducing alignment requirements.
Definition at line 146 of file RMiniFile.hxx.
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.
std::uint64_t ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fFilePos = 0 |
Keeps track of the seek offset.
Definition at line 148 of file RMiniFile.hxx.
unsigned char* ROOT::Experimental::Internal::RNTupleFileWriter::RFileSimple::fHeaderBlock = nullptr |
Definition at line 138 of file RMiniFile.hxx.
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.
|
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.
|
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.