-
Libing Song authored
Binlog events are read in a stream pipeline/chain way, like: Byte Stream --> Event Data Stream --> Event Object Stream - Event data is the serialized binlog event. It is a chunk of data in buffer. Event data istream read data from byte stream and organize byte data into event data. - Event object stream trasforms event data to Log_event object. Byte Stream includes: - Binlog_ifile Read binlog files generated on master side - Relaylog_ifile Read binlog files generated on slave side - Mysqlbinlog_ifile Read both master and slave side binlog files through os files or stdin. Event Data Stream includes: - Binlog_event_data_istream Event_data is serialized event object. It is a chunk of data in buffer. Binlog_event_data_istream fetches byte data from Basic_istream and divides them into event_data chunk according to the format. - Mysqlbinlog_event_data_istream Handle a couple of special things from mysqlbinlog Event Object Stream includes: - Binlog_event_object_istream It read event_data from an event data stream and deserialize the event_datas to Log_event object. * Reader classes To make code simple and easy to use the pipeline is encapsulate in to a template class called Basic_binlog_file_reader. It owns a byte stream, an event_data stream and an event object stream. The stream pipeline is setup in constructor. All the objects required for reading a binlog file is initialized in reader class. It also includes some convenient functions to encapsulate the access of the streams. Reader classes have: - Binlog_file_reader - Relaylog_file_reader - Binlog_sender::File_reader - Mysqlbinlog_file_reader
Libing Song authoredBinlog events are read in a stream pipeline/chain way, like: Byte Stream --> Event Data Stream --> Event Object Stream - Event data is the serialized binlog event. It is a chunk of data in buffer. Event data istream read data from byte stream and organize byte data into event data. - Event object stream trasforms event data to Log_event object. Byte Stream includes: - Binlog_ifile Read binlog files generated on master side - Relaylog_ifile Read binlog files generated on slave side - Mysqlbinlog_ifile Read both master and slave side binlog files through os files or stdin. Event Data Stream includes: - Binlog_event_data_istream Event_data is serialized event object. It is a chunk of data in buffer. Binlog_event_data_istream fetches byte data from Basic_istream and divides them into event_data chunk according to the format. - Mysqlbinlog_event_data_istream Handle a couple of special things from mysqlbinlog Event Object Stream includes: - Binlog_event_object_istream It read event_data from an event data stream and deserialize the event_datas to Log_event object. * Reader classes To make code simple and easy to use the pipeline is encapsulate in to a template class called Basic_binlog_file_reader. It owns a byte stream, an event_data stream and an event object stream. The stream pipeline is setup in constructor. All the objects required for reading a binlog file is initialized in reader class. It also includes some convenient functions to encapsulate the access of the streams. Reader classes have: - Binlog_file_reader - Relaylog_file_reader - Binlog_sender::File_reader - Mysqlbinlog_file_reader
Loading