binlog user header

This commit is contained in:
2020-08-12 20:01:24 +03:00
parent e77d3a86a9
commit 294831df17
3 changed files with 35 additions and 4 deletions

View File

@@ -25,7 +25,7 @@
#include "pifile.h"
#define PIBINARYLOG_VERSION 0x31
#define PIBINARYLOG_VERSION 0x32
namespace __S__PIBinaryLog {
static const uchar binlog_sig[] = {'B','I','N','L','O','G'};
}
@@ -207,7 +207,12 @@ public:
//! Returns timestamp of last readed record
PISystemTime lastReadedTimestamp() const {return lastrecord.timestamp;}
//!Set custom file header, you can get it back when read this binlog
void setHeader(const PIByteArray & header);
//!Get custom file header
PIByteArray getHeader();
#ifdef DOXYGEN
//! Read one message from binlog file, with ID contains in "filterID" or any ID, if "filterID" is empty
int read(void *read_to, int max_size);
@@ -321,6 +326,7 @@ private:
llong split_size, log_size;
int write_count, split_count, default_id, current_index;
bool is_started, is_thread_ok, is_indexed, rapid_start, is_pause;
PIByteArray user_header, user_header_readed;
};
//! \relatesalso PICout \relatesalso PIBinaryLog::BinLogInfo \brief Output operator to PICout