Abstract all row event processing

The code that handles the Avro files is now fully abstracted behind the
AvroConverter class that implements the RowEventHandler interface.

The code still has some avro specific behavior in a few places (parsing of
JSON files into TableCreate objects). This can be replaced, if needed, by
querying the master server for the CREATE TABLE statements.
This commit is contained in:
Markus Mäkelä
2018-06-07 17:52:53 +03:00
parent d094e93209
commit 7c18696608
10 changed files with 531 additions and 475 deletions

View File

@ -13,7 +13,6 @@
#include "avrorouter.hh"
#include <avro/errors.h>
#include <ctype.h>
#include <ini.h>
#include <stdio.h>
@ -24,7 +23,6 @@
#include <glob.h>
#include <ini.h>
#include <sys/stat.h>
#include <avro/errors.h>
#include <maxscale/alloc.h>
#include <maxscale/atomic.h>
#include <maxscale/dcb.h>
@ -286,7 +284,7 @@ bool converter_func(Worker::Call::action_t action, Avro* router)
/** We reached end of file, flush unwritten records to disk */
if (progress)
{
avro_flush_all_tables(router, AVROROUTER_FLUSH);
router->event_hander->flush_tables();
avro_save_conversion_state(router);
logged = false;
}