Tarantool development patches archive
 help / color / mirror / Atom feed
From: Timur Safin <tsafin@tarantool.org>
To: v.shpilevoy@tarantool.org, alexander.turenko@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH 2.X v2.1 0/4] module api: extend for external merger Lua module
Date: Sun, 11 Oct 2020 17:39:48 +0300	[thread overview]
Message-ID: <cover.1602425022.git.tsafin@tarantool.org> (raw)

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

             reply	other threads:[~2020-10-11 14:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 14:39 Timur Safin [this message]
2020-10-11 14:39 ` [Tarantool-patches] [PATCH 2.X v2.1 1/4] module api: export box_tuple_validate Timur Safin
2020-10-11 15:42   ` Vladislav Shpilevoy
2020-10-11 15:51     ` Timur Safin
2020-10-11 14:39 ` [Tarantool-patches] [PATCH 2.X v2.1 2/4] module api: export box_key_def_dup Timur Safin
2020-10-11 14:39 ` [Tarantool-patches] [PATCH 2.X v2.1 3/4] module api: luaL_checkibuf Timur Safin
2020-10-11 14:39 ` [Tarantool-patches] [PATCH 2.X v2.1 4/4] module api: external merger tests Timur Safin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1602425022.git.tsafin@tarantool.org \
    --to=tsafin@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2.X v2.1 0/4] module api: extend for external merger Lua module' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox