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 764FA6C7D2; Thu, 11 Feb 2021 09:52:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 764FA6C7D2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1613026357; bh=uXMxttk1XxmFrBfwmNdHhzrRi2R4O0kyCmsr421FftQ=; 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=Y7RR/JW236c3FBkXrTi/FDhvrVLQhTpsQS26uxAxZ2RTDTqbSGJiDVt3Cg+4sYc/8 +RTR3HNGAxJh36lnuZXMWL6VfY28OreTp75rGzjvozd2qdKcSwp2MNMBug1t2GTJYy IaUcoiaUclKnJ9NSFK/x/6CkOul95fQggRDqDfCU= Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [94.100.177.107]) (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 BE0816AABD for ; Thu, 11 Feb 2021 09:51:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BE0816AABD Received: by smtp47.i.mail.ru with esmtpa (envelope-from ) id 1lA5oj-0008Jn-NB; Thu, 11 Feb 2021 09:51:10 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@tarantool.org References: <259e9595aefe7a28af13eb6dd336ea8f145c2112.1612914070.git.v.shpilevoy@tarantool.org> <805dc520-0146-6fb0-29ec-f621bc8d2a8b@tarantool.org> <05a72aa4-39d9-1009-ba4e-48ce7b105d35@tarantool.org> Message-ID: Date: Thu, 11 Feb 2021 09:51:09 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <05a72aa4-39d9-1009-ba4e-48ce7b105d35@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9C55152E5B36F7009490E3DBC75EBFD4CE182A05F5380850408909617BF0873DEBB2DB95BE91342D8AB1E153CE5785E298B618A596B71319C2 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE768BD42809A772457EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063790333AD7CC3E6A518638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC7BF04B2A11D85FC62B1057528C8FDD4769E761DF86577DF7389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C04CF195F1528592878941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6E232F00D8D26902CA471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC2CE340A784E694483AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F790063705CD5B7CBC81277BD81D268191BDAD3D698AB9A7B718F8C442539A7722CA490C13377AFFFEAFD26923F8577A6DFFEA7CB04B26703878C8DC93EC92FD9297F6715571747095F342E857739F23D657EF2BD5E8D9A59859A8B698B1B85E56A716AC089D37D7C0E48F6C5571747095F342E857739F23D657EF2B6825BDBE14D8E7028C9DFF55498CEFB0BD9CCCA9EDD067B1EDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5A5106B28727C079F7676187761ADB2BC8A78FB64C1CA4F1AD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344F2126FF337FA651C1404AD5B38FE0200BBAFBD4C7BA78C2BCEE753245493CDD50EA5DA5920DA1B21D7E09C32AA3244C729D2ABFAAEFCE76EE1ED8DADD06DFE7795D98D676DD64D0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmjFTaBTEi1Z6ovOnDd03PQ== X-Mailru-Sender: 583F1D7ACE8F49BD9317CE1922F30C7EAA7CCD9166FDBDB5A87056CBE8FF0A42FD4B8B46F2305AD123E75C7104EB1B885DEE61814008E47C7013064206BFB89F93956FB04BA385BE9437F6177E88F7363CDA0F3B3F5B9367 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: Oleg Babin via Tarantool-patches Reply-To: Oleg Babin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for your fixes! I found you've missed to add new file to "vshard/CMakeLists.txt" [1] [1] https://github.com/tarantool/vshard/blob/master/vshard/CMakeLists.txt#L9 On 11/02/2021 01:36, Vladislav Shpilevoy wrote: > 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. Yes, thanks for your answer. Got it. >>> 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)