Lua: prepare to intercept box.process results into Lua.
Remove dead code from txn_cleanup(), which would check that txn_cleanup() is not called twice: this code is from the time when we used Rename txn_abort() to txn_rollback(). Rename txn_alloc() to txn_begin(). Introduce box_out interface, used to send box results to the client. Lua uses this interface to intercept returned tuples and push as return values to Lua stack. Make iov_add/iov_dup inline, as they used to be. They are now mostly used from within callbacks. Make txn_commit()/txn_rollback() non-static as they are now used in memcached.m. Introduce memcached_get(): implementation of Memcached GET statement. Wrap memcached_get() in proper txn_begin()/txn_commit()/txn_rollback(), and handle failure of memcached_get() by rolling back the transaction. Split BOX_QUIET to two flags: BOX_GC_TXN and BOX_QUIET. BOX_QUIET had a side-effect that txn_cleanup() was done immediately, rather than by fiber_gc(). This had the side effect that txn_commit() could not be used in memcached_get(), because in memcached_get() we need both BOX_QUIET and txn_cleanup() called from fiber_gc(). Now that we have box_out interface, eliminate BOX_QUIET flag completely, and use box_out_quiet set of callbacks instead.
Showing
- core/admin.m 15 additions, 0 deletionscore/admin.m
- core/fiber.m 0 additions, 15 deletionscore/fiber.m
- include/errcode.h 1 addition, 1 deletioninclude/errcode.h
- include/fiber.h 18 additions, 3 deletionsinclude/fiber.h
- mod/box/box.h 17 additions, 8 deletionsmod/box/box.h
- mod/box/box.m 96 additions, 98 deletionsmod/box/box.m
- mod/box/memcached-grammar.m 231 additions, 293 deletionsmod/box/memcached-grammar.m
- mod/box/memcached-grammar.rl 12 additions, 74 deletionsmod/box/memcached-grammar.rl
- mod/box/memcached.m 86 additions, 2 deletionsmod/box/memcached.m
- mod/box/tuple.h 7 additions, 0 deletionsmod/box/tuple.h
- test/box_memcached/multiversioning.result 2 additions, 2 deletionstest/box_memcached/multiversioning.result
- test/box_memcached/multiversioning.test 3 additions, 2 deletionstest/box_memcached/multiversioning.test
Loading
Please register or sign in to comment