ATLAS Offline Software
|
#include <v5_DataWriter.h>
Public Types | |
using | iovec_const = offline_EventStorage_v5::iovec_const |
Public Member Functions | |
DataWriter (const std::string &writingPath, const std::string &fileNameCore, const run_parameters_record &rPar, const std::vector< std::string > &fmdStrings, const unsigned int startIndex=1, const CompressionType compression=NONE, const unsigned int compLevel=1) | |
constructor with metadata strings More... | |
DataWriter (const std::string &writingPath, boost::shared_ptr< EventStorage::FileNameCallback > theFNCB, const run_parameters_record &rPar, const std::string &project, const std::string &streamType, const std::string &streamName, const std::string &stream, const unsigned int lumiBlockNumber, const std::string &applicationName, const std::vector< std::string > &fmdStrings, const CompressionType compression=NONE, const unsigned int compLevel=1) | |
DataWriter (const std::string &writingPath, const std::string &fileNameCore, const run_parameters_record &rPar, const std::string &project, const std::string &streamType, const std::string &streamName, const std::string &stream, const unsigned int lumiBlockNumber, const std::string &applicationName, const std::vector< std::string > &fmdStrings, const CompressionType compression=NONE, const unsigned int compLevel=1) | |
~DataWriter () | |
destructor, the way to close the sequence of files More... | |
EventStorage::DWError | setMaxFileNE (const unsigned int &maxFileNE) |
max size of 1 file in number of data blocks (or events) 1 putData call is one block More... | |
EventStorage::DWError | setMaxFileMB (const unsigned int &maxFileMB) |
max size of 1 file in MB. More... | |
void | setGUID (const std::string &GUID) |
Set the GUID for the next file in this sequence. More... | |
bool | good () const |
feedback to user More... | |
void | cd (const std::string &writingPath) |
set another writing path More... | |
bool | inTransition () const |
The file currently open is not closed immediately after cd() this method will return true if we are in transition phase, i.e. More... | |
EventStorage::DWError | putData (const unsigned int &dataSize, const void *event) |
Write a single block of data. More... | |
EventStorage::DWError | putPrecompressedData (const unsigned int &dataSize, const void *event) |
Write a single block of data already compressed. More... | |
EventStorage::DWError | putPrecompressedData (const unsigned int &entries, const iovec_const *my_iovec) |
Write a single block of data already compressed. More... | |
EventStorage::DWError | putData (const unsigned int &entries, const struct iovec *my_iovec) |
Write data when you have one event scattered in many blocks, in memory, like in the SFI application. More... | |
EventStorage::DWError | putData (const unsigned int &dataSize, const void *event, uint32_t &sizeToDisk) |
Write a single block of data. More... | |
EventStorage::DWError | putData (const unsigned int &entries, const iovec_const *my_iovec, uint32_t &sizeToDisk) |
Write data when you have one event scattered in many blocks, in memory, like in the SFI application. More... | |
EventStorage::DWError | closeFile () |
Close the currently open file. More... | |
EventStorage::DWError | nextFile () |
close the file and open next one immediately More... | |
std::string | nameFile (const FileStatus &fs) const |
get the name of the current file More... | |
int64_t | getPosition () const |
get the offset of the latest written event; one should call it AFTER putData(...) More... | |
unsigned int | eventsInFile () const |
number of events written to the currently open file More... | |
unsigned int | eventsInFileSequence () const |
number of events written to the file sequence More... | |
unsigned int | dataMB_InFile () const |
number of mega bytes written to the current file More... | |
unsigned int | dataMB_InFileSequence () const |
number of mega bytes written to the file sequence More... | |
void | registerCallBack (EventStorage::DataWriterCallBack *pUserCBclass) |
If you want to define actions to be taken when a file is open or closed register your call-back class here with this method. More... | |
CompressionType | getCompression () const |
Returns the compression type for this file. More... | |
void | setGuid (const std::string &Guid) |
Externally set the GUID for the next file in this sequence. More... | |
Private Member Functions | |
DataWriter () | |
void | initDW (const std::string &writingPath, boost::shared_ptr< EventStorage::FileNameCallback > theFNCB, const run_parameters_record &rPar, const std::string &project, const std::string &streamType, const std::string &streamName, const std::string &stream, const unsigned int lumiBlockNumber, const std::string &applicationName, const std::vector< std::string > &fmdStrings, const CompressionType compression, const unsigned int compLevel) |
EventStorage::DWError | putData_implementation (const unsigned int &entries, const iovec_const *my_iovec, uint32_t &sizeToDisk, bool precompressed=false) |
void | date_timeAsInt (uint32_t &getDate, uint32_t &getTime) const |
void | openNextFile () |
bool | fileExists (const std::string &name) const |
void | setRunParamsRecord (const run_parameters_record &rPar) |
void | file_record (void *ri, const void *pi) |
void | file_record (const file_name_strings &nst) |
void | file_record (const freeMetaDataStrings &fmdStrings) |
std::string | getAppName (const std::string &fileNameCore) const |
std::string | getElement (const std::string &fileNameCore, const std::string &element) const |
uint64_t | getFileSize (const std::string &fileNameCore) const |
void | spaceForGuid () |
void | replaceGuid () |
Private Attributes | |
std::fstream | m_cFile |
bool | m_cFileOpen |
bool | m_openFailed |
file_start_record | m_file_start_record |
file_name_strings | m_file_name_strings |
internal_run_parameters_record | m_internal_run_parameters_record |
file_end_record | m_file_end_record |
std::string | m_guid |
std::string | m_next_guid |
std::string | m_writePath |
std::string | m_nextWritePath |
std::string | m_fileNameCore |
std::string | m_project |
std::string | m_streamType |
std::string | m_streamName |
std::string | m_stream |
unsigned int | m_lumiBlockNumber |
std::string | m_applicationName |
CompressionType | m_compression |
unsigned int | m_complevel |
DataBuffer * | m_compressed |
double | m_cFileMB |
long double | m_runMB |
uLong | m_check |
int64_t | m_latestPosition |
EventStorage::DataWriterCallBack * | m_callBack |
freeMetaDataStrings | m_fmdStrings |
boost::shared_ptr< EventStorage::FileNameCallback > | m_filenamecallback |
Definition at line 44 of file v5_DataWriter.h.
Definition at line 47 of file v5_DataWriter.h.
DataWriter::DataWriter | ( | const std::string & | writingPath, |
const std::string & | fileNameCore, | ||
const run_parameters_record & | rPar, | ||
const std::vector< std::string > & | fmdStrings, | ||
const unsigned int | startIndex = 1 , |
||
const CompressionType | compression = NONE , |
||
const unsigned int | compLevel = 1 |
||
) |
constructor with metadata strings
writingPath | directory where to write data |
fileNameCore | file name not including the ending "._NNNN.data" |
run_parameters_record | rPar other parameters from IS including the run number |
fmdStrings | optional vector of strings containing metadata |
startIndex | initial file sequence index |
compression | Compression type |
compLevel | Compression level |
Definition at line 52 of file v5_DataWriter.cxx.
offline_EventStorage_v5::DataWriter::DataWriter | ( | const std::string & | writingPath, |
boost::shared_ptr< EventStorage::FileNameCallback > | theFNCB, | ||
const run_parameters_record & | rPar, | ||
const std::string & | project, | ||
const std::string & | streamType, | ||
const std::string & | streamName, | ||
const std::string & | stream, | ||
const unsigned int | lumiBlockNumber, | ||
const std::string & | applicationName, | ||
const std::vector< std::string > & | fmdStrings, | ||
const CompressionType | compression = NONE , |
||
const unsigned int | compLevel = 1 |
||
) |
DataWriter::DataWriter | ( | const std::string & | writingPath, |
const std::string & | fileNameCore, | ||
const run_parameters_record & | rPar, | ||
const std::string & | project, | ||
const std::string & | streamType, | ||
const std::string & | streamName, | ||
const std::string & | stream, | ||
const unsigned int | lumiBlockNumber, | ||
const std::string & | applicationName, | ||
const std::vector< std::string > & | fmdStrings, | ||
const CompressionType | compression = NONE , |
||
const unsigned int | compLevel = 1 |
||
) |
Definition at line 97 of file v5_DataWriter.cxx.
|
private |
DataWriter::~DataWriter | ( | ) |
destructor, the way to close the sequence of files
Definition at line 117 of file v5_DataWriter.cxx.
void DataWriter::cd | ( | const std::string & | writingPath | ) |
DWError DataWriter::closeFile | ( | ) |
Close the currently open file.
Next file will be open anyway if you try to write again afterwards.
Definition at line 444 of file v5_DataWriter.cxx.
unsigned int DataWriter::dataMB_InFile | ( | ) | const |
number of mega bytes written to the current file
Definition at line 433 of file v5_DataWriter.cxx.
unsigned int DataWriter::dataMB_InFileSequence | ( | ) | const |
number of mega bytes written to the file sequence
Definition at line 438 of file v5_DataWriter.cxx.
|
private |
unsigned int DataWriter::eventsInFile | ( | ) | const |
number of events written to the currently open file
Definition at line 423 of file v5_DataWriter.cxx.
unsigned int DataWriter::eventsInFileSequence | ( | ) | const |
number of events written to the file sequence
Definition at line 428 of file v5_DataWriter.cxx.
|
private |
Definition at line 663 of file v5_DataWriter.cxx.
|
private |
Definition at line 704 of file v5_DataWriter.cxx.
|
private |
Definition at line 645 of file v5_DataWriter.cxx.
|
private |
|
private |
offline_EventStorage_v5::CompressionType DataWriter::getCompression | ( | ) | const |
Returns the compression type for this file.
Definition at line 792 of file v5_DataWriter.cxx.
|
private |
|
private |
Definition at line 779 of file v5_DataWriter.cxx.
int64_t DataWriter::getPosition | ( | ) | const |
get the offset of the latest written event; one should call it AFTER putData(...)
Definition at line 417 of file v5_DataWriter.cxx.
bool DataWriter::good | ( | ) | const |
|
private |
Definition at line 130 of file v5_DataWriter.cxx.
bool DataWriter::inTransition | ( | ) | const |
The file currently open is not closed immediately after cd() this method will return true if we are in transition phase, i.e.
the file has not yet been closed after a cd()
Definition at line 636 of file v5_DataWriter.cxx.
string DataWriter::nameFile | ( | const FileStatus & | fs | ) | const |
DWError DataWriter::nextFile | ( | ) |
close the file and open next one immediately
Definition at line 518 of file v5_DataWriter.cxx.
|
private |
Definition at line 544 of file v5_DataWriter.cxx.
Write a single block of data.
If one of the size limits would be exceeded, the current file will be closed and another one will be opened automatically.
dataSize | size of the event in bytes |
*event | start of the event data in memory |
Definition at line 277 of file v5_DataWriter.cxx.
DWError DataWriter::putData | ( | const unsigned int & | dataSize, |
const void * | event, | ||
uint32_t & | sizeToDisk | ||
) |
Write a single block of data.
If one of the size limits would be exceeded, the current file will be closed and another one will be opened automatically.
dataSize | size of the eveny in bytes |
*event | start of the event data in memory |
&sizeToDisk | will be update with the actual chunck size on disk |
Definition at line 294 of file v5_DataWriter.cxx.
DWError DataWriter::putData | ( | const unsigned int & | entries, |
const iovec_const * | my_iovec, | ||
uint32_t & | sizeToDisk | ||
) |
Write data when you have one event scattered in many blocks, in memory, like in the SFI application.
If one of the size limits would be exceeded, the current file will be closed and another one will be opened automatically.
entries | number of the data chunks |
my_iovec | locations of the data chunks |
&sizeToDisk | will be update with the actual chunck size on disk |
Definition at line 302 of file v5_DataWriter.cxx.
Write data when you have one event scattered in many blocks, in memory, like in the SFI application.
If one of the size limits would be exceeded, the current file will be closed and another one will be opened automatically.
number | of the data chunks |
locations | of the data chunks |
Definition at line 288 of file v5_DataWriter.cxx.
|
private |
Definition at line 325 of file v5_DataWriter.cxx.
Write a single block of data already compressed.
WARNING* the library has now way to check if the compression algorithm matches the declared file type. The data is directly written to the file without check, completely trusting the caller. Use with care! If one of the size limits would be exceeded, the current file will be closed and another one will be opened automatically.
dataSize | size of the eveny in bytes |
*event | start of the event data in memory |
Definition at line 307 of file v5_DataWriter.cxx.
DWError DataWriter::putPrecompressedData | ( | const unsigned int & | entries, |
const iovec_const * | my_iovec | ||
) |
Write a single block of data already compressed.
WARNING* the library has now way to check if the compression algorithm matches the declared file type. The data is directly written to the file without check, completely trusting the caller. Use with care! If one of the size limits would be exceeded, the current file will be closed and another one will be opened automatically.
number | of the data chunks |
locations | of the data chunks |
Definition at line 317 of file v5_DataWriter.cxx.
void DataWriter::registerCallBack | ( | EventStorage::DataWriterCallBack * | pUserCBclass | ) |
If you want to define actions to be taken when a file is open or closed register your call-back class here with this method.
Definition at line 737 of file v5_DataWriter.cxx.
|
private |
Definition at line 759 of file v5_DataWriter.cxx.
void offline_EventStorage_v5::DataWriter::setGUID | ( | const std::string & | GUID | ) |
Set the GUID for the next file in this sequence.
void DataWriter::setGuid | ( | const std::string & | Guid | ) |
Externally set the GUID for the next file in this sequence.
Definition at line 774 of file v5_DataWriter.cxx.
DWError DataWriter::setMaxFileMB | ( | const unsigned int & | maxFileMB | ) |
max size of 1 file in MB.
The file is closed before this limit is overrun.
Definition at line 248 of file v5_DataWriter.cxx.
DWError DataWriter::setMaxFileNE | ( | const unsigned int & | maxFileNE | ) |
max size of 1 file in number of data blocks (or events) 1 putData call is one block
Definition at line 254 of file v5_DataWriter.cxx.
|
private |
Definition at line 260 of file v5_DataWriter.cxx.
|
private |
Definition at line 754 of file v5_DataWriter.cxx.
|
private |
Definition at line 326 of file v5_DataWriter.h.
|
private |
Definition at line 338 of file v5_DataWriter.h.
|
private |
Definition at line 304 of file v5_DataWriter.h.
|
private |
Definition at line 332 of file v5_DataWriter.h.
|
private |
Definition at line 306 of file v5_DataWriter.h.
|
private |
Definition at line 334 of file v5_DataWriter.h.
|
private |
Definition at line 329 of file v5_DataWriter.h.
|
private |
Definition at line 330 of file v5_DataWriter.h.
|
private |
Definition at line 328 of file v5_DataWriter.h.
|
private |
Definition at line 312 of file v5_DataWriter.h.
|
private |
Definition at line 310 of file v5_DataWriter.h.
|
private |
Definition at line 309 of file v5_DataWriter.h.
|
private |
Definition at line 342 of file v5_DataWriter.h.
|
private |
Definition at line 319 of file v5_DataWriter.h.
|
private |
Definition at line 340 of file v5_DataWriter.h.
|
private |
Definition at line 314 of file v5_DataWriter.h.
|
private |
Definition at line 311 of file v5_DataWriter.h.
|
private |
Definition at line 336 of file v5_DataWriter.h.
|
private |
Definition at line 325 of file v5_DataWriter.h.
|
private |
Definition at line 315 of file v5_DataWriter.h.
|
private |
Definition at line 318 of file v5_DataWriter.h.
|
private |
Definition at line 307 of file v5_DataWriter.h.
|
private |
Definition at line 321 of file v5_DataWriter.h.
|
private |
Definition at line 333 of file v5_DataWriter.h.
|
private |
Definition at line 324 of file v5_DataWriter.h.
|
private |
Definition at line 323 of file v5_DataWriter.h.
|
private |
Definition at line 322 of file v5_DataWriter.h.
|
private |
Definition at line 317 of file v5_DataWriter.h.