Definition at line 1396 of file mlogger.cxx.
◆ WriterLZ4()
Definition at line 1399 of file mlogger.cxx.
1400 {
1402 printf(
"WriterLZ4: path [%s]\n", log_chn->
path.c_str());
1403
1404 assert(wr != NULL);
1405
1410 }
◆ ~WriterLZ4()
| WriterLZ4::~WriterLZ4 |
( |
| ) |
|
|
inline |
Definition at line 1412 of file mlogger.cxx.
1413 {
1415 printf("WriterLZ4: destructor\n");
1416
1419 }
◆ wr_close()
| int WriterLZ4::wr_close |
( |
LOG_CHN * |
log_chn, |
|
|
int |
run_number |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 1519 of file mlogger.cxx.
1520 {
1522 MLZ4F_errorCode_t errorCode;
1523
1525 printf(
"WriterLZ4: close path [%s]\n", log_chn->
path.c_str());
1526
1528
1529
1531
1532 if (MLZ4F_isError(headerSize)) {
1533 errorCode = headerSize;
1534 cm_msg(
MERROR,
"WriterLZ4::wr_close",
"LZ4F_compressEnd() error %d (%s)", (
int)errorCode, MLZ4F_getErrorName(errorCode));
1536 }
1537
1539
1542
1546 }
1547
1548
1549
1551
1555 }
1556
1557
1558
1562
1563 errorCode = MLZ4F_freeCompressionContext(
fContext);
1564 if (MLZ4F_isError(errorCode)) {
1565 cm_msg(
MERROR,
"WriterLZ4::wr_close",
"LZ4F_freeCompressionContext() error %d (%s)", (
int)errorCode, MLZ4F_getErrorName(errorCode));
1568 }
1569
1570 return xstatus;
1571 }
virtual int wr_close(LOG_CHN *log_chn, int run_number)=0
virtual int wr_write(LOG_CHN *log_chn, const void *data, const int size)=0
MLZ4F_compressionContext_t fContext
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
◆ wr_get_chain()
| std::string WriterLZ4::wr_get_chain |
( |
| ) |
|
|
inlinevirtual |
◆ wr_get_file_ext()
| std::string WriterLZ4::wr_get_file_ext |
( |
| ) |
|
|
inlinevirtual |
◆ wr_open()
| int WriterLZ4::wr_open |
( |
LOG_CHN * |
log_chn, |
|
|
int |
run_number |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 1421 of file mlogger.cxx.
1422 {
1424 MLZ4F_errorCode_t errorCode;
1425
1427 printf(
"WriterLZ4: open path [%s]\n", log_chn->
path.c_str());
1428
1432 }
1433
1434 errorCode = MLZ4F_createCompressionContext(&
fContext, MLZ4F_VERSION);
1435 if (MLZ4F_isError(errorCode)) {
1436 cm_msg(
MERROR,
"WriterLZ4::wr_open",
"LZ4F_createCompressionContext() error %d (%s)", (
int)errorCode, MLZ4F_getErrorName(errorCode));
1438 }
1439
1440 MLZ4F_blockSizeID_t blockSizeId = MLZ4F_max4MB;
1446 cm_msg(
MERROR,
"WriterLZ4::wr_open",
"Cannot malloc() %d bytes for an LZ4 compression buffer, block size %d, errno %d (%s)",
fBufferSize,
fBlockSize, errno, strerror(errno));
1448 }
1449
1451
1452 fPrefs.compressionLevel = 0;
1454 fPrefs.frameInfo.contentChecksumFlag = MLZ4F_contentChecksumEnabled;
1455 fPrefs.frameInfo.blockSizeID = blockSizeId;
1456
1458
1459 if (MLZ4F_isError(headerSize)) {
1460 errorCode = headerSize;
1461 cm_msg(
MERROR,
"WriterLZ4::wr_open",
"LZ4F_compressBegin() error %d (%s)", (
int)errorCode, MLZ4F_getErrorName(errorCode));
1463 }
1464
1466
1469
1472 }
1473
1475
1477 }
virtual int wr_open(LOG_CHN *log_chn, int run_number)=0
MLZ4F_preferences_t fPrefs
◆ wr_write()
| int WriterLZ4::wr_write |
( |
LOG_CHN * |
log_chn, |
|
|
const void * |
data, |
|
|
const int |
size |
|
) |
| |
|
inlinevirtual |
Implements WriterInterface.
Definition at line 1479 of file mlogger.cxx.
1480 {
1481 const char* ptr = (
const char*)
data;
1482 int remaining = size;
1483
1485 printf(
"WriterLZ4: write path [%s], size %d\n", log_chn->
path.c_str(), size);
1486
1487 while (remaining > 0) {
1488 int wsize = remaining;
1489
1492
1494
1495 if (MLZ4F_isError(outSize)) {
1496 int errorCode = outSize;
1497 cm_msg(
MERROR,
"WriterLZ4::wr_write",
"LZ4F_compressUpdate() with %d bytes, block size %d, buffer size %d, write size %d, remaining %d bytes, error %d (%s)", wsize,
fBlockSize,
fBufferSize, size, remaining, (
int)errorCode, MLZ4F_getErrorName(errorCode));
1499 }
1500
1501 if (outSize > 0) {
1503
1506
1509 }
1510 }
1511
1512 ptr += wsize;
1513 remaining -= wsize;
1514 }
1515
1517 }
◆ fBlockSize
| int WriterLZ4::fBlockSize |
|
private |
◆ fBuffer
◆ fBufferSize
| int WriterLZ4::fBufferSize |
|
private |
◆ fContext
| MLZ4F_compressionContext_t WriterLZ4::fContext |
|
private |
◆ fPrefs
| MLZ4F_preferences_t WriterLZ4::fPrefs |
|
private |
◆ fWr
The documentation for this class was generated from the following file: