From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp14.mail.ru (smtp14.mail.ru [94.100.181.95]) (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 745E8469719 for ; Sun, 11 Oct 2020 17:40:09 +0300 (MSK) From: Timur Safin Date: Sun, 11 Oct 2020 17:39:48 +0300 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 2.X v2.1 0/4] 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. Plans for v3 ------------ 1. Reshuffle patchet to merge test with corresponding code; 2. Add ibuf wrapper, despite all controversies Stay tuned... 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-v2 (top 5 commits above of 14 @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 (4): module api: export box_tuple_validate module api: export box_key_def_dup module api: luaL_checkibuf module api: external merger tests src/box/key_def_api.c | 6 +++++ src/box/key_def_api.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