From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BE03E469719 for ; Mon, 12 Oct 2020 03:44:29 +0300 (MSK) From: Timur Safin Date: Mon, 12 Oct 2020 03:44:08 +0300 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 2.X v3 0/3] module api: extend for external merger Lua module List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: v.shpilevoy@tarantool.org, alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org This patchset is a continuation of patch series which Alexander Turenko sends elsewhere. It extends module api with the necessary wrappers we should have in api to make external merger possible. Some internal functionality which was acessible to internal merger, should be wrapped via accessors if merger is becoming external. - most of introduced functions are simple public wrappers around of internal functions, e.g. `box_tuple_validate` is a wrapper around `tuple_validate_raw`, or `bax_key_def_dup` is a wrapper for `key_def_dup`. They were necessary to not reveal implementation specific details (i.e. `tuple_data` needed in `tuple_validate_raw` should know `box_tuple_t` layout); - wherever we used to use `struct tuple *` we replacing them with public alias `box_tuple_t`. Same is for `struct tuple_format` -> `box_tuple_format_t` and other typedefs. Changelog of v2 to v1 --------------------- Please do not be surprised to not seen v2 in your inbox - it was cancelled after discussion with Alexander Turenko (see v2.1 below with descriptions) - Unpublished again `lauT_temp_state`, `luaT_release_temp_state` - they are performance wrappers around creation of Lua thread states. Agreed that performance impact not that big, thus created similar compatibility wrappers on the module side; - unpublished `luaT_newthread`, because for module usage `lua_newthread` is enough; - unpublished `luaL_register_module` & `luaL_register_type` and reworked module code with `luaL_register`. Smallish changelog of v2.1 to v2 -------------------------------- Alexander Turenko has provided valuable feedback to the v2 branch I've shown, so we have yet more reduced this patchset - Unpublished `luaL_cdata_iscallable`, it's unnecessary for external module which is using now public `luaL_iscallable` module api call, instead of compatibility layer in module; - Unpublished `luaL_checkconstchar` because it's not yet needed anywhere externally; - Accordingly to thsoe changes above we have reduced code in module_api test files. Changelog for v3 ---------------- - Reshuffled patchset to merge tests with their corresponding code; I'm sending this version because it's too late already and I need to sleep... Plans for v3.1 -------------- - Add ibuf wrapper, despite all controversies it's coming soon... Issue: * https://github.com/tarantool/tarantool/issues/5384 ('module api: expose everything that is needed for external merger module') Branches: * https://github.com/tarantool/tarantool/tree/tsafin/gh-5273-expand-module-api-v3 (top 3 commits above of a bunch of @Totktonada's commits) * 1.10 branch will be sent momentarily as a followup. Stay tuned == External merger module Currently external merger is residing here https://github.com/tsafin/tarantool-merge and it uses key_def from https://github.com/Totktonada/key_def repository via simple luarocks dependency (we had to introduce debugging rock-server to make this working). CI is installed and is running on GitHub Actions, thus we know that it's sort of working together (UPD: used to work before key_def api reshuffled recently), but more extensive testing of merger and key_def yet to be proceeded. Timur Safin (3): module api: export box_tuple_validate module api: export box_key_def_dup module api: luaL_checkibuf src/box/key_def.c | 6 +++++ src/box/key_def.h | 10 +++++++ src/box/tuple.c | 6 +++++ src/box/tuple.h | 11 ++++++++ src/exports.h | 3 +++ src/lua/utils.h | 16 ++++++------ test/app-tap/module_api.c | 26 ++++++++++++++++++ test/app-tap/module_api.test.lua | 45 +++++++++++++++++++++++++++++++- 8 files changed, 114 insertions(+), 9 deletions(-) -- 2.20.1