From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id C5C8B2EA48 for ; Tue, 14 May 2019 19:06:29 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bxUoPHqMi0Hv for ; Tue, 14 May 2019 19:06:29 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 1B0842740B for ; Tue, 14 May 2019 19:06:29 -0400 (EDT) From: Vladislav Shpilevoy Subject: [tarantool-patches] [PATCH 1/7] swim: drop swim_info() function Date: Wed, 15 May 2019 02:06:19 +0300 Message-Id: <48add4439cbc964c3c591d8b843be03f8de2a254.1557875116.git.v.shpilevoy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: kostja@tarantool.org 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. 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)