From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org
Cc: vdavydov.dev@gmail.com
Subject: [PATCH v2 07/10] port: rename dump() into dump_msgpack()
Date: Fri, 20 Apr 2018 16:24:32 +0300 [thread overview]
Message-ID: <ea694995e95690258108215a623cded995840ffe.1524228894.git.v.shpilevoy@tarantool.org> (raw)
In-Reply-To: <cover.1524228894.git.v.shpilevoy@tarantool.org>
In-Reply-To: <cover.1524228894.git.v.shpilevoy@tarantool.org>
In #2677 a port must be able to dump both msgpack into obuf for
binary box.session.push(), and text with no obuf for text
box.session.push.
---
src/box/iproto.cc | 6 +++---
src/box/lua/call.c | 4 ++--
src/box/port.c | 18 +++++++++---------
src/box/port.h | 12 ++++++------
4 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/box/iproto.cc b/src/box/iproto.cc
index a284368d3..38baf1b8d 100644
--- a/src/box/iproto.cc
+++ b/src/box/iproto.cc
@@ -1233,7 +1233,7 @@ tx_process_select(struct cmsg *m)
/*
* SELECT output format has not changed since Tarantool 1.6
*/
- count = port_dump_16(&port, out);
+ count = port_dump_msgpack_16(&port, out);
port_destroy(&port);
if (count < 0) {
/* Discard the prepared select. */
@@ -1323,9 +1323,9 @@ tx_process_call(struct cmsg *m)
}
if (msg->header.type == IPROTO_CALL_16)
- count = port_dump_16(&port, out);
+ count = port_dump_msgpack_16(&port, out);
else
- count = port_dump(&port, out);
+ count = port_dump_msgpack(&port, out);
port_destroy(&port);
if (count < 0) {
obuf_rollback_to_svp(out, &svp);
diff --git a/src/box/lua/call.c b/src/box/lua/call.c
index be13812aa..2f5c9deec 100644
--- a/src/box/lua/call.c
+++ b/src/box/lua/call.c
@@ -416,8 +416,8 @@ port_lua_destroy(struct port *base)
}
static const struct port_vtab port_lua_vtab = {
- .dump = port_lua_dump,
- .dump_16 = port_lua_dump_16,
+ .dump_msgpack = port_lua_dump,
+ .dump_msgpack_16 = port_lua_dump_16,
.destroy = port_lua_destroy,
};
diff --git a/src/box/port.c b/src/box/port.c
index 03f6be79d..255eb732c 100644
--- a/src/box/port.c
+++ b/src/box/port.c
@@ -96,7 +96,7 @@ port_tuple_destroy(struct port *base)
}
static int
-port_tuple_dump_16(struct port *base, struct obuf *out)
+port_tuple_dump_msgpack_16(struct port *base, struct obuf *out)
{
struct port_tuple *port = port_tuple(base);
struct port_tuple_entry *pe;
@@ -113,14 +113,14 @@ port_tuple_dump_16(struct port *base, struct obuf *out)
}
static int
-port_tuple_dump(struct port *base, struct obuf *out)
+port_tuple_dump_msgpack(struct port *base, struct obuf *out)
{
struct port_tuple *port = port_tuple(base);
char *size_buf = obuf_alloc(out, mp_sizeof_array(port->size));
if (size_buf == NULL)
return -1;
mp_encode_array(size_buf, port->size);
- if (port_tuple_dump_16(base, out) < 0)
+ if (port_tuple_dump_msgpack_16(base, out) < 0)
return -1;
return 1;
}
@@ -132,15 +132,15 @@ port_destroy(struct port *port)
}
int
-port_dump(struct port *port, struct obuf *out)
+port_dump_msgpack(struct port *port, struct obuf *out)
{
- return port->vtab->dump(port, out);
+ return port->vtab->dump_msgpack(port, out);
}
int
-port_dump_16(struct port *port, struct obuf *out)
+port_dump_msgpack_16(struct port *port, struct obuf *out)
{
- return port->vtab->dump_16(port, out);
+ return port->vtab->dump_msgpack_16(port, out);
}
void
@@ -157,7 +157,7 @@ port_free(void)
}
const struct port_vtab port_tuple_vtab = {
- .dump = port_tuple_dump,
- .dump_16 = port_tuple_dump_16,
+ .dump_msgpack = port_tuple_dump_msgpack,
+ .dump_msgpack_16 = port_tuple_dump_msgpack_16,
.destroy = port_tuple_destroy,
};
diff --git a/src/box/port.h b/src/box/port.h
index 7cf3339b5..1c44b9b00 100644
--- a/src/box/port.h
+++ b/src/box/port.h
@@ -70,12 +70,12 @@ struct port_vtab {
* On success returns number of entries dumped.
* On failure sets diag and returns -1.
*/
- int (*dump)(struct port *port, struct obuf *out);
+ int (*dump_msgpack)(struct port *port, struct obuf *out);
/**
- * Same as dump(), but use the legacy Tarantool 1.6
- * format.
+ * Same as dump_msgpack(), but use the legacy Tarantool
+ * 1.6 format.
*/
- int (*dump_16)(struct port *port, struct obuf *out);
+ int (*dump_msgpack_16)(struct port *port, struct obuf *out);
/**
* Destroy a port and release associated resources.
*/
@@ -149,14 +149,14 @@ port_destroy(struct port *port);
* Return number of entries dumped on success, -1 on error.
*/
int
-port_dump(struct port *port, struct obuf *out);
+port_dump_msgpack(struct port *port, struct obuf *out);
/**
* Same as port_dump(), but use the legacy Tarantool 1.6
* format.
*/
int
-port_dump_16(struct port *port, struct obuf *out);
+port_dump_msgpack_16(struct port *port, struct obuf *out);
void
port_init(void);
--
2.15.1 (Apple Git-101)
next prev parent reply other threads:[~2018-04-20 13:24 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-20 13:24 [PATCH v2 00/10] session: introduce box.session.push Vladislav Shpilevoy
2018-04-20 13:24 ` [PATCH v2 01/10] yaml: don't throw OOM on any error in yaml encoding Vladislav Shpilevoy
2018-05-10 18:10 ` [tarantool-patches] " Konstantin Osipov
2018-04-20 13:24 ` [tarantool-patches] [PATCH v2 10/10] session: introduce binary box.session.push Vladislav Shpilevoy
2018-05-10 19:50 ` Konstantin Osipov
2018-05-24 20:50 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-20 13:24 ` [PATCH v2 02/10] yaml: introduce yaml.encode_tagged Vladislav Shpilevoy
2018-05-10 18:22 ` [tarantool-patches] " Konstantin Osipov
2018-05-24 20:50 ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-30 19:15 ` Konstantin Osipov
2018-05-30 20:49 ` Vladislav Shpilevoy
2018-05-31 10:46 ` Konstantin Osipov
2018-04-20 13:24 ` [PATCH v2 03/10] yaml: introduce yaml.decode_tag Vladislav Shpilevoy
2018-05-10 18:41 ` [tarantool-patches] " Konstantin Osipov
2018-05-24 20:50 ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-31 10:54 ` Konstantin Osipov
2018-05-31 11:36 ` Konstantin Osipov
2018-04-20 13:24 ` [PATCH v2 04/10] console: use Lua C API to do formatting for console Vladislav Shpilevoy
2018-05-10 18:46 ` [tarantool-patches] " Konstantin Osipov
2018-05-24 20:50 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-20 13:24 ` [PATCH v2 05/10] session: move salt into iproto connection Vladislav Shpilevoy
2018-05-10 18:47 ` [tarantool-patches] " Konstantin Osipov
2018-04-20 13:24 ` [PATCH v2 06/10] session: introduce session vtab and meta Vladislav Shpilevoy
2018-05-10 19:20 ` [tarantool-patches] " Konstantin Osipov
2018-05-24 20:50 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-20 13:24 ` Vladislav Shpilevoy [this message]
2018-05-10 19:21 ` [tarantool-patches] [PATCH v2 07/10] port: rename dump() into dump_msgpack() Konstantin Osipov
2018-04-20 13:24 ` [PATCH v2 08/10] session: introduce text box.session.push Vladislav Shpilevoy
2018-05-10 19:27 ` [tarantool-patches] " Konstantin Osipov
2018-05-24 20:50 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-20 13:24 ` [PATCH v2 09/10] session: enable box.session.push in local console Vladislav Shpilevoy
2018-05-10 19:28 ` [tarantool-patches] " Konstantin Osipov
2018-05-24 20:50 ` [tarantool-patches] [PATCH 1/1] netbox: introduce iterable future objects Vladislav Shpilevoy
2018-06-04 22:17 ` [tarantool-patches] " Vladislav Shpilevoy
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=ea694995e95690258108215a623cded995840ffe.1524228894.git.v.shpilevoy@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=vdavydov.dev@gmail.com \
--subject='Re: [PATCH v2 07/10] port: rename dump() into dump_msgpack()' \
/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