From reviews-return-54460-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Wed Jan 25 09:59:11 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 DEB8F19E11 for ; Wed, 25 Jan 2017 09:59:11 +0000 (UTC) Received: (qmail 81731 invoked by uid 500); 25 Jan 2017 09:59:11 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 81693 invoked by uid 500); 25 Jan 2017 09:59:11 -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 81671 invoked by uid 99); 25 Jan 2017 09:59:11 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jan 2017 09:59:11 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 10B5C3174B2; Wed, 25 Jan 2017 09:59:10 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6367180052980005070==" MIME-Version: 1.0 Subject: Re: Review Request 54836: Added helpers to allocate / unallocate Resources. From: Guangya Liu To: Benjamin Bannier , Michael Park , Guangya Liu , Jay Guo Cc: Mesos Reviewbot , Benjamin Mahler , mesos Date: Wed, 25 Jan 2017 09:59:10 -0000 Message-ID: <20170125095910.13408.28010@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Guangya Liu X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/54836/ X-Sender: Guangya Liu References: <20161218011026.17251.43385@reviews.apache.org> In-Reply-To: <20161218011026.17251.43385@reviews.apache.org> Reply-To: Guangya Liu X-ReviewRequest-Repository: mesos --===============6367180052980005070== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit > On 十二月 18, 2016, 1:10 a.m., Guangya Liu wrote: > > src/common/resources.cpp, line 1062 > > > > > > Shall we add a `CHECK` here to make sure this resource was not allocated to any role? > > Benjamin Mahler wrote: > We could, the alternative that I went for was to have callers (the allocator) CHECK this invariant if they care about it, since it seems specific to the way the allocator works. > > Guangya Liu wrote: > I saw that you have updated the comments of `allocate` by allowing existing allocation info be overwitten by a new role, why do we allow this? Which secnario need this operation? > > Benjamin Mahler wrote: > It's not clear if we have a scenario that needs the ability to overwrite, it's just the behavior I would intuit, much like set_role overwrites if there is a role already set. Still have one question: For which case shall we need to overwrite the role? Ideally, the role info should be cleared when `recoverResources`, so if there are still roles when `allocate`, we should report an error? - Guangya ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/54836/#review159564 ----------------------------------------------------------- On 一月 23, 2017, 1:55 a.m., Benjamin Mahler wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/54836/ > ----------------------------------------------------------- > > (Updated 一月 23, 2017, 1:55 a.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 > > --===============6367180052980005070==--