MXS-1413: Move cdc_connector into a subdirectory

Moved the cdc_connector into a subdirectory to distinct it from the other
test sources.
This commit is contained in:
Markus Mäkelä
2017-09-14 08:52:45 +03:00
parent a6a7249cb5
commit 52da6c0214
6 changed files with 38 additions and 4 deletions

View File

@ -0,0 +1,47 @@
#include <cstdint>
#include <string>
/** Request format flags */
#define CDC_REQUEST_TYPE_JSON (1 << 0)
#define CDC_REQUEST_TYPE_AVRO (1 << 1)
namespace CDC
{
class Connection
{
public:
Connection(const std::string& address,
uint16_t port,
const std::string& user,
const std::string& password,
uint32_t flags = CDC_REQUEST_TYPE_JSON);
virtual ~Connection();
bool createConnection();
bool requestData(const std::string& table, const std::string& gtid = "");
bool readRow(std::string& dest);
void closeConnection();
const std::string& getSchema() const
{
return m_schema;
}
const std::string& getError() const
{
return m_error;
}
private:
int m_fd;
uint32_t m_flags;
uint16_t m_port;
std::string m_address;
std::string m_user;
std::string m_password;
std::string m_error;
std::string m_schema;
bool doAuth();
bool doRegistration();
};
}