[patches] [PATCH 4/7] iproto: move IPROTO_METADATA fields to a new enum, start from 0
Konstantin Osipov
kostja at tarantool.org
Thu Mar 29 17:31:37 MSK 2018
* Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [18/02/28 22:41]:
> IPROTO_FIELD_NAME is now a single metadata key, and it is stored
> always only inside IPROTO_METADATA. So it can be moved to a
> separate enum with metadata keys, starting from 0. This frees
> space in enum iproto_key gaps.
>
OK to push.
> Signed-off-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
> ---
> src/box/iproto_constants.c | 3 +--
> src/box/iproto_constants.h | 10 +++++++++-
> src/box/lua/net_box.lua | 2 +-
> 3 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/src/box/iproto_constants.c b/src/box/iproto_constants.c
> index 21c3b1696..e90e0062b 100644
> --- a/src/box/iproto_constants.c
> +++ b/src/box/iproto_constants.c
> @@ -86,7 +86,6 @@ const unsigned char iproto_key_type[IPROTO_KEY_MAX] =
> /* 0x26 */ MP_MAP, /* IPROTO_VCLOCK */
> /* 0x27 */ MP_STR, /* IPROTO_EXPR */
> /* 0x28 */ MP_ARRAY, /* IPROTO_OPS */
> - /* 0x29 */ MP_STR, /* IPROTO_FIELD_NAME */
> /* }}} */
> };
>
> @@ -167,7 +166,7 @@ const char *iproto_key_strs[IPROTO_KEY_MAX] = {
> "vector clock", /* 0x26 */
> "expression", /* 0x27 */
> "operations", /* 0x28 */
> - "field name", /* 0x29 */
> + NULL, /* 0x29 */
> NULL, /* 0x2a */
> NULL, /* 0x2b */
> NULL, /* 0x2c */
> diff --git a/src/box/iproto_constants.h b/src/box/iproto_constants.h
> index ea4ab3254..c06092386 100644
> --- a/src/box/iproto_constants.h
> +++ b/src/box/iproto_constants.h
> @@ -87,7 +87,6 @@ enum iproto_key {
> /* Also request keys. See the comment above. */
> IPROTO_EXPR = 0x27, /* EVAL */
> IPROTO_OPS = 0x28, /* UPSERT but not UPDATE ops, because of legacy */
> - IPROTO_FIELD_NAME = 0x29,
>
> /* Leave a gap between request keys and response keys */
> IPROTO_DATA = 0x30,
> @@ -115,6 +114,15 @@ enum iproto_key {
> IPROTO_KEY_MAX
> };
>
> +/**
> + * Keys, stored in IPROTO_METADATA. They can not be received
> + * in a request. Only sent as response, so no necessity in _strs
> + * or _key_type arrays.
> + */
> +enum iproto_metadata_key {
> + IPROTO_FIELD_NAME = 0,
> +};
> +
> #define bit(c) (1ULL<<IPROTO_##c)
>
> #define IPROTO_HEAD_BMAP (bit(REQUEST_TYPE) | bit(SYNC) | bit(REPLICA_ID) |\
> diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua
> index 2710b8dad..18d1ce083 100644
> --- a/src/box/lua/net_box.lua
> +++ b/src/box/lua/net_box.lua
> @@ -39,7 +39,7 @@ local IPROTO_SCHEMA_VERSION_KEY = 0x05
> local IPROTO_METADATA_KEY = 0x32
> local IPROTO_SQL_INFO_KEY = 0x43
> local IPROTO_SQL_ROW_COUNT_KEY = 0x44
> -local IPROTO_FIELD_NAME_KEY = 0x29
> +local IPROTO_FIELD_NAME_KEY = 0
> local IPROTO_DATA_KEY = 0x30
> local IPROTO_ERROR_KEY = 0x31
> local IPROTO_GREETING_SIZE = 128
> --
> 2.14.3 (Apple Git-98)
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list