[tarantool-patches] [PATCH 0/3] JSON update preparation: reorganize code

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sat Sep 28 01:29:08 MSK 2019


The patchset is a third part of preparations to JSON updates of a tuple.
There are 3 independent commits.

First commit reorganizes code. Before the commit there was one huge file
implementing tuple update. Soon amount of the code will be much larger, and a
new code structure was needed to be able to maintain it. Now tuple update
implementation consists of several files. One file for general update functions
and structures, one file for top-level API used by other tarantool code, and
one file per each non-trivial type of field update.

The second commit introduces a function to compare JSON tokens not stored in any
JSON tree. It will be used by JSON updates to compare two JSON paths token by
token. Strcmp() of course could not be used, because the same token can be
written differently (["a"] vs .a).

The third patch is perhaps the hardest. Its commit message is quite
comprehensive and detailed, I won't duplicate it here.

Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-1261-update-json-preparation-3
Issue: https://github.com/tarantool/tarantool/issues/1261

Vladislav Shpilevoy (3):
  tuple: rework updates to improve code extendibility
  json: lexer_eof and token_cmp helper functions
  tuple: account the whole array in field.data and size

 src/box/CMakeLists.txt                      |    4 +-
 src/box/lua/tuple.c                         |    2 +-
 src/box/memtx_space.c                       |    2 +-
 src/box/space.c                             |    2 +-
 src/box/tuple.c                             |    2 +-
 src/box/tuple.h                             |    2 +-
 src/box/tuple_update.c                      | 1468 -------------------
 src/box/update/update.c                     |  499 +++++++
 src/box/{tuple_update.h => update/update.h} |    6 +-
 src/box/update/update_array.c               |  292 ++++
 src/box/update/update_field.c               |  639 ++++++++
 src/box/update/update_field.h               |  413 ++++++
 src/box/vinyl.c                             |    2 +-
 src/box/vy_upsert.c                         |    2 +-
 src/lib/json/json.c                         |   37 +-
 src/lib/json/json.h                         |   28 +
 test/box/tuple.result                       |    4 +-
 test/unit/column_mask.c                     |    2 +-
 18 files changed, 1900 insertions(+), 1506 deletions(-)
 delete mode 100644 src/box/tuple_update.c
 create mode 100644 src/box/update/update.c
 rename src/box/{tuple_update.h => update/update.h} (95%)
 create mode 100644 src/box/update/update_array.c
 create mode 100644 src/box/update/update_field.c
 create mode 100644 src/box/update/update_field.h

-- 
2.21.0 (Apple Git-122)





More information about the Tarantool-patches mailing list