From reviews-return-54693-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Sun Jan 29 00:41:36 2017 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2BBA619673 for ; Sun, 29 Jan 2017 00:41:36 +0000 (UTC) Received: (qmail 27166 invoked by uid 500); 29 Jan 2017 00:41:36 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 27122 invoked by uid 500); 29 Jan 2017 00:41:36 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 27100 invoked by uid 99); 29 Jan 2017 00:41:35 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Jan 2017 00:41:35 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id D98FF3191D0; Sun, 29 Jan 2017 00:41:33 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============3795587352875561505==" MIME-Version: 1.0 Subject: Re: Review Request 54836: Added helpers to allocate / unallocate Resources. From: Michael Park To: Benjamin Bannier , Michael Park , Guangya Liu , Jay Guo Cc: Mesos Reviewbot , Benjamin Mahler , mesos Date: Sun, 29 Jan 2017 00:41:33 -0000 Message-ID: <20170129004133.13408.67558@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Michael Park X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/54836/ X-Sender: Michael Park References: <20170125095406.13408.78039@reviews.apache.org> In-Reply-To: <20170125095406.13408.78039@reviews.apache.org> Reply-To: Michael Park X-ReviewRequest-Repository: mesos --===============3795587352875561505== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Jan. 25, 2017, 1:54 a.m., Michael Park wrote: > > include/mesos/resources.hpp, lines 332-339 > > > > > > I would've expected: > > ```cpp > > void allocate(const std::string& role); > > void unallocate(); > > ``` > > > > Could you help me understand what the `bool` from `unallocate` is for? > > > > If it's simply to indicate whether the function had any effects or > > not, `allocate` could also return a `bool`, which returns `false` > > when the resources were already allocated for the specified role. > > Guangya Liu wrote: > For `allocate`, seems the question here is same as mine above: In which case shall we need to overwrite the role for allocation? > > Guangya Liu wrote: > @mpark, I think that Ben already posted some comments here for why return `bool` for `unallocate` at https://reviews.apache.org/r/54836/#comment230598 > > Michael Park wrote: > @bmahler, Actually, upon looking further in the chain I realized that mutating the resources here is new... > You had mentioned this to me as well and explained why (I think), could you explain again here > why we didn't do `allocations` (which we already have), `allocated` and `unallocated`? > Similar to `reservations`, `reserved` and `unreserved`? Never mind, regarding my last comment. I had another realization that we're not trying to filter for `allocated` and `unallocated` resources, but rather want to mutate them. - Michael ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/54836/#review162927 ----------------------------------------------------------- On Jan. 22, 2017, 5:55 p.m., Benjamin Mahler wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/54836/ > ----------------------------------------------------------- > > (Updated Jan. 22, 2017, 5:55 p.m.) > > > Review request for mesos, Benjamin Bannier, Jay Guo, Guangya Liu, and Michael Park. > > > Repository: mesos > > > Description > ------- > > Added helpers to allocate / unallocate Resources. > > > Diffs > ----- > > include/mesos/resources.hpp c2e6d6680d9687f0bbfb73e84ffb1457072c4412 > include/mesos/v1/resources.hpp 98f025b68c818c384a1174ef9b969f5c0776a7f1 > src/common/resources.cpp be9bca2063e9f0e60c5faa0142077bea56272e45 > src/tests/resources_tests.cpp 8dfb1be35d9f9c6ff69139d055c6b3d3ec475e68 > src/v1/resources.cpp da4701c03020ff9c33ef995cd0af437d8827c267 > > Diff: https://reviews.apache.org/r/54836/diff/ > > > Testing > ------- > > Updated the existing allocation test to incorporate the new helper. > > > Thanks, > > Benjamin Mahler > > --===============3795587352875561505==--