From a19d93380eaded0bc903ec05531fc521152cc4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 29 Jun 2017 21:15:09 +0300 Subject: [PATCH] Make block_size a size parameter The block_size signifies a size in bytes so it makes sense to change it to the size type. --- Documentation/Routers/Avrorouter.md | 6 +++++- server/modules/routing/avrorouter/avro.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Documentation/Routers/Avrorouter.md b/Documentation/Routers/Avrorouter.md index ebce9e5de..ed3d4e2a8 100644 --- a/Documentation/Routers/Avrorouter.md +++ b/Documentation/Routers/Avrorouter.md @@ -174,7 +174,11 @@ data block. The default value is 1000 row events. #### `block_size` The Avro data block size in bytes. The default is 16 kilobytes. Increase this -value if individual events in the binary logs are very large. +value if individual events in the binary logs are very large. The value is a +size type parameter which means that it can also be defined with an SI +suffix. Refer to the +[Configuration Guide](../Getting-Started/Configuration-Guide.md) for more +details about size type parameters and how to use them. ## Module commands diff --git a/server/modules/routing/avrorouter/avro.c b/server/modules/routing/avrorouter/avro.c index 70e4931e3..2c6125da7 100644 --- a/server/modules/routing/avrorouter/avro.c +++ b/server/modules/routing/avrorouter/avro.c @@ -201,7 +201,7 @@ MXS_MODULE* MXS_CREATE_MODULE() {"group_rows", MXS_MODULE_PARAM_COUNT, "1000"}, {"group_trx", MXS_MODULE_PARAM_COUNT, "1"}, {"start_index", MXS_MODULE_PARAM_COUNT, "1"}, - {"block_size", MXS_MODULE_PARAM_COUNT, "0"}, + {"block_size", MXS_MODULE_PARAM_SIZE, "0"}, {"codec", MXS_MODULE_PARAM_ENUM, "null", MXS_MODULE_OPT_ENUM_UNIQUE, codec_values}, {MXS_END_MODULE_PARAMS} } @@ -425,7 +425,7 @@ createInstance(SERVICE *service, char **options) inst->trx_target = config_get_integer(params, "group_trx"); inst->codec = config_get_enum(params, "codec", codec_values); int first_file = config_get_integer(params, "start_index"); - inst->block_size = config_get_integer(params, "block_size"); + inst->block_size = config_get_size(params, "block_size"); MXS_CONFIG_PARAMETER *param = config_get_param(params, "source"); inst->gtid.domain = 0;