From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 67AA071814; Thu, 11 Feb 2021 01:36:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 67AA071814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612996593; bh=aP3PtHMxSq13cnqxF7hHZQnSan4j25+nv5kv7hON2ho=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Q39pRM4ierjCf2y5Oor3cbWvcNi5LhrhSbsozhLDPmWmQULtCkZ1Bt62jc0crzeXg OBbVM3DYozSJUCQ3L0G8w9t8u7yw8kWgiL+TiELSjOAejKKVbL+F7z37HbP3ar/A/2 RUT5n/oEIGk1DERHn2GYDmk2gi5HATO9RjoTHmYQ= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BEB0571814 for ; Thu, 11 Feb 2021 01:36:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BEB0571814 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1l9y5w-00084F-QB; Thu, 11 Feb 2021 01:36:25 +0300 To: Oleg Babin , tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@tarantool.org References: <259e9595aefe7a28af13eb6dd336ea8f145c2112.1612914070.git.v.shpilevoy@tarantool.org> <805dc520-0146-6fb0-29ec-f621bc8d2a8b@tarantool.org> Message-ID: <05a72aa4-39d9-1009-ba4e-48ce7b105d35@tarantool.org> Date: Wed, 10 Feb 2021 23:36:23 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <805dc520-0146-6fb0-29ec-f621bc8d2a8b@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9C3D690943982D6E894AC6DB5C833CB876182A05F5380850403E463735E7C66CEB832544667C5BA105090CCE2E67531B978463995BEF51BE77 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7518FA0CDCCF25698EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BEEB0D1ADA650026EA1F7E6F0F101C674E70A05D1297E1BBC6CDE5D1141D2B1C6F15E8520A8121267B1A804C13B449A8512EB33ACC9ED8479FA2833FD35BB23D9E625A9149C048EE33AC447995A7AD18BDFBBEFFF4125B51D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B1BE95B8C87527B4BA471835C12D1D977C4224003CC836476EC64975D915A344093EC92FD9297F6718AA50765F79006376A91CFDE938F542CA7F4EDE966BC389F395957E7521B51C24C7702A67D5C33162DBA43225CD8A89F9FFED5BD9FB41755C6EABA9B74D0DA47B5C8C57E37DE458B4C7702A67D5C3316FA3894348FB808DBAF038BB36E94EA6B574AF45C6390F7469DAA53EE0834AAEE X-B7AD71C0: 6FEFE4C63DFE2D85469AD6E133326EAB664F5199923B286E81C2AD9CFA0FBF5C9C2BBA594F31363B5803BE1F3B17DC36E8F7B195E1C9783173E7D363EF45D4327E6ED54993E2D80B X-C1DE0DAB: 0D63561A33F958A591D79F1E3021EDCD170C7C5D05B47848B55BDCB0E7D92778D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75F04B387B5D7535DE410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D9DC20663B80603F0351E5DCB93FCA43F6275928BF4D7ADB728574D208ECD67676E116F153117A7B1D7E09C32AA3244C4FC8D6F02356798FD34B5EE0B5FF2DCC795D98D676DD64D0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmMmQ+JvDeDHw2ofxBVcRvg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638226A4D99BDCABEC27A6ACCA28B7F0AA75A3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 9/9] util: introduce binary heap data structure X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for the review! On 10.02.2021 10:01, Oleg Babin wrote: > Thanks for your patch. > > Shouldn't it be added to storage "MODULE_INTERNALS" ? Hm. Not sure I understand. Did you mean 'vshard_modules' variable in storage/init.lua? Why? The heap is not used in storage/init.lua and won't be used there directly in future patches. The next patches will introduce new modules for storage/, which will use the heap, and will reload it. Also it does not have any global objects. So it does not need its own global M, if this is what you meant. >> diff --git a/test/unit-tap/heap.test.lua b/test/unit-tap/heap.test.lua >> new file mode 100755 >> index 0000000..8c3819f >> --- /dev/null >> +++ b/test/unit-tap/heap.test.lua >> @@ -0,0 +1,310 @@ >> +#!/usr/bin/env tarantool >> + >> +local tap = require('tap') >> +local test = tap.test("cfg") >> +local heap = require('vshard.heap') >> + > > > Maybe it's better to use single brackets everywhere: test("cfg") -> test('cfg'). Or does such difference have some sense? Yeah, didn't notice it. Here is the diff: ==================== diff --git a/test/unit-tap/heap.test.lua b/test/unit-tap/heap.test.lua index 8c3819f..9202f62 100755 --- a/test/unit-tap/heap.test.lua +++ b/test/unit-tap/heap.test.lua @@ -1,7 +1,7 @@ #!/usr/bin/env tarantool local tap = require('tap') -local test = tap.test("cfg") +local test = tap.test('cfg') local heap = require('vshard.heap') -- @@ -109,7 +109,7 @@ local function test_min_heap_basic(test) until not next_permutation(indexes) end - test:ok(true, "no asserts") + test:ok(true, 'no asserts') end -- @@ -143,7 +143,7 @@ local function test_max_heap_basic(test) until not next_permutation(indexes) end - test:ok(true, "no asserts") + test:ok(true, 'no asserts') end -- @@ -178,7 +178,7 @@ local function test_min_heap_update_top(test) until not next_permutation(indexes) end - test:ok(true, "no asserts") + test:ok(true, 'no asserts') end -- @@ -219,7 +219,7 @@ local function test_min_heap_update(test) end end - test:ok(true, "no asserts") + test:ok(true, 'no asserts') end -- @@ -257,7 +257,7 @@ local function test_max_heap_delete(test) end end - test:ok(true, "no asserts") + test:ok(true, 'no asserts') end local function test_min_heap_remove_top(test) @@ -273,7 +273,7 @@ local function test_min_heap_remove_top(test) end assert(h:count() == 0) - test:ok(true, "no asserts") + test:ok(true, 'no asserts') end local function test_max_heap_remove_try(test) @@ -294,7 +294,7 @@ local function test_max_heap_remove_try(test) assert(obj.index == -1) assert(h:count() == 1) - test:ok(true, "no asserts") + test:ok(true, 'no asserts') end test:plan(7)