Add initial support for deflate compression in maxavro

Maxavro now supports reading records with the zlib deflate
algorithm.

With this change, each data block is read into memory in one IO
operation. This allows the library to decompress the data block if
necessary.

The avrorouter does not yet use compression when writing the records.
This commit is contained in:
Markus Mäkelä
2017-02-21 13:03:38 +02:00
parent 1d8d526a01
commit c47ef968f7
10 changed files with 295 additions and 130 deletions

View File

@ -615,7 +615,7 @@ static bool stream_json(AVRO_CLIENT *client)
set_current_gtid(client, row);
json_decref(row);
}
bytes += file->block_size;
bytes += file->buffer_size;
}
while (maxavro_next_block(file) && bytes < AVRO_DATA_BURST_SIZE);
@ -639,7 +639,7 @@ static bool stream_binary(AVRO_CLIENT *client)
while (rc > 0 && bytes < AVRO_DATA_BURST_SIZE)
{
bytes += file->block_size;
bytes += file->buffer_size;
if ((buffer = maxavro_record_read_binary(file)))
{
rc = dcb->func.write(dcb, buffer);