Add deflate compression to avrorouter

The avrorouter can now compress the Avro files using the deflate algorithm
provided by zlib.
This commit is contained in:
Markus Mäkelä
2017-02-21 16:14:59 +02:00
parent c47ef968f7
commit c3cc46ae04
5 changed files with 50 additions and 4 deletions

View File

@ -106,7 +106,7 @@ void avro_close_binlog(int fd)
* @param filepath Path to the created file
* @param json_schema The schema of the table in JSON format
*/
AVRO_TABLE* avro_table_alloc(const char* filepath, const char* json_schema)
AVRO_TABLE* avro_table_alloc(const char* filepath, const char* json_schema, const char *codec)
{
AVRO_TABLE *table = MXS_CALLOC(1, sizeof(AVRO_TABLE));
if (table)
@ -127,7 +127,8 @@ AVRO_TABLE* avro_table_alloc(const char* filepath, const char* json_schema)
}
else
{
rc = avro_file_writer_create(filepath, table->avro_schema, &table->avro_file);
rc = avro_file_writer_create_with_codec(filepath, table->avro_schema,
&table->avro_file, codec, 0);
}
if (rc)