[Tarantool-patches] [PATCH 2.X v2.1 0/4] module api: extend for external merger Lua module
Timur Safin
tsafin at tarantool.org
Sun Oct 11 17:39:48 MSK 2020
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
More information about the Tarantool-patches
mailing list