[tarantool-patches] [PATCH 1/7] swim: drop swim_info() function

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed May 15 02:06:19 MSK 2019


Swim_info() was a function to dump SWIM instance info to a Lua
table without explicit usage of Lua. But now all the info can be
taken from 1) self member and member API, 2) cached cfg options
as a Lua table in a forthcoming Lua API - this is how
box.cfg.<index> works.
---
 src/lib/swim/swim.c | 20 --------------------
 src/lib/swim/swim.h |  5 -----
 2 files changed, 25 deletions(-)

diff --git a/src/lib/swim/swim.c b/src/lib/swim/swim.c
index fa6b3a379..006c265b3 100644
--- a/src/lib/swim/swim.c
+++ b/src/lib/swim/swim.c
@@ -35,7 +35,6 @@
 #include "uri/uri.h"
 #include "fiber.h"
 #include "msgpuck.h"
-#include "info/info.h"
 #include "assoc.h"
 #include "sio.h"
 #define HEAP_FORWARD_DECLARATION
@@ -1911,25 +1910,6 @@ swim_broadcast(struct swim *swim, int port)
 	return 0;
 }
 
-void
-swim_info(struct swim *swim, struct info_handler *info)
-{
-	info_begin(info);
-	for (mh_int_t node = mh_first(swim->members),
-	     end = mh_end(swim->members); node != end;
-	     node = mh_next(swim->members, node)) {
-		struct swim_member *m =
-			*mh_swim_table_node(swim->members, node);
-		info_table_begin(info, swim_inaddr_str(&m->addr));
-		info_append_str(info, "status",
-				swim_member_status_strs[m->status]);
-		info_append_str(info, "uuid", tt_uuid_str(&m->uuid));
-		info_append_int(info, "incarnation", (int64_t) m->incarnation);
-		info_table_end(info);
-	}
-	info_end(info);
-}
-
 int
 swim_size(const struct swim *swim)
 {
diff --git a/src/lib/swim/swim.h b/src/lib/swim/swim.h
index 331bd14f0..044558dc8 100644
--- a/src/lib/swim/swim.h
+++ b/src/lib/swim/swim.h
@@ -38,7 +38,6 @@
 extern "C" {
 #endif
 
-struct info_handler;
 struct swim;
 struct tt_uuid;
 struct swim_iterator;
@@ -153,10 +152,6 @@ swim_probe_member(struct swim *swim, const char *uri);
 int
 swim_broadcast(struct swim *swim, int port);
 
-/** Dump member statuses into @a info. */
-void
-swim_info(struct swim *swim, struct info_handler *info);
-
 /** Get SWIM member table size. */
 int
 swim_size(const struct swim *swim);
-- 
2.20.1 (Apple Git-117)





More information about the Tarantool-patches mailing list