MXS-1881: Pass the RowEventConverer as a parameter

The RowEventConverter is now passed as a parameter to the Avro
instance. Wrapped the value in an std::auto_ptr to make the cleanup
automatic (when it is implemented).

Fixed a typo in the event handler member variable and removed the unused
stats member.
This commit is contained in:
Markus Mäkelä
2018-06-09 20:09:45 +03:00
parent 8f76cf5f5a
commit c39fa4009e
6 changed files with 32 additions and 33 deletions

View File

@ -123,7 +123,7 @@ class Avro: public MXS_ROUTER
Avro& operator=(const Avro&) = delete;
public:
static Avro* create(SERVICE* service);
static Avro* create(SERVICE* service, SRowEventHandler handler);
SERVICE* service; /*< Pointer to the service using this router */
std::string filestem; /*< Root of binlog filename */
@ -148,15 +148,10 @@ public:
uint64_t row_target; /*< Minimum about of row events that will trigger
* a flush of all tables */
uint32_t task_handle; /**< Delayed task handle */
RowEventHandler* event_hander;
struct
{
int n_clients; /*< Number client sessions created */
} stats; /*< Statistics for this router */
SRowEventHandler event_handler;
private:
Avro(SERVICE* service, MXS_CONFIG_PARAMETER* params, SERVICE* source);
Avro(SERVICE* service, MXS_CONFIG_PARAMETER* params, SERVICE* source, SRowEventHandler handler);
void read_source_service_options(SERVICE* source);
};