[Tarantool-patches] [PATCH 2.X 0/7] RFC: module api: extend for external merger Lua module

Timur Safin tsafin at tarantool.org
Thu Sep 24 20:00:13 MSK 2020


This patchset is a continuation of patch series which Alexander Turenko has sent 
earlier on. 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.

- eventually merger in Tarantool core might get deprecated and all new 
  development for merger will continue in version agnostic external module
  thus we decided that common utility functions (e.g. `luaT_temp_luastate`)
  which used to reside in merger to better be sitting in `src/lua/utils.c`
  instead (in addition to becoming public as described above).

NB! You could observe, that this part of changes for merger in module_api is
much, much easier than those for key_def as sent by Sasha Turenko before.

Issue:
* https://github.com/tarantool/tarantool/issues/5273 
  ('module api: expose everything that is needed for external key_def module')

Branches:
* https://github.com/tarantool/tarantool/tree/tsafin/gh-5273-expand-module-api
  (top 7 commits above of 14 @Totktonada's commits)
* https://github.com/tarantool/tarantool/tree/tsafin/gh-5273-expand-module-api-1.10
  (last 9 commits above of 16 @Totktonada's commits)

== 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, but more extensive testing of merger and key_def 
yet to be proceeded. Though it might be done independently of current 
kernel patches.


Timur Safin (7):
  module api: export box_tuple_validate
  module api: export box_key_def_dup
  module api: luaT_newthread
  module api: luaL_register_module & luaL_register_type
  module api: luaT_temp_luastate & luaT_release_temp_luastate
  module api: luaL_checkibuf & luaL_checkconstchar
  module api: luaL_cdata_iscallable

 src/box/key_def_api.c |  6 +++
 src/box/key_def_api.h | 10 +++++
 src/box/lua/merger.c  | 78 -------------------------------------
 src/box/tuple.c       |  6 +++
 src/box/tuple.h       | 11 ++++++
 src/exports.h         | 10 +++++
 src/lua/utils.c       | 51 ++++++++++++++++++++++++-
 src/lua/utils.h       | 89 ++++++++++++++++++++++++++++++++++++-------
 8 files changed, 169 insertions(+), 92 deletions(-)

-- 
2.20.1



More information about the Tarantool-patches mailing list