summaryrefslogtreecommitdiff
path: root/lib/input/replStream.h
blob: 40ec390708470e2843c2baf5d90eedbc11204952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef MYGRATE_INPUT_REPLSTREAM_H
#define MYGRATE_INPUT_REPLSTREAM_H

#include "mysqlConn.h"
#include <cstdint>
#include <eventSourceBase.h>
#include <string>

namespace MyGrate {
	class EventHandlerBase;
}

namespace MyGrate::Input {
	class ReplicationStream : public EventSourceBase, public MySQLConn {
	public:
		ReplicationStream(const std::string & host, const std::string & user, const std::string & pass,
				unsigned short port, uint64_t serverid, std::string filename, uint64_t position);

		void readEvents(EventHandlerBase &) override;
		void stopEvents() override;

	private:
		uint64_t serverid;
		std::string filename;
		uint64_t position;
	};
}

#endif