Return-Path: X-Original-To: apmail-mesos-dev-archive@www.apache.org Delivered-To: apmail-mesos-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0FE8810A61 for ; Tue, 3 Mar 2015 20:26:17 +0000 (UTC) Received: (qmail 3998 invoked by uid 500); 3 Mar 2015 20:26:11 -0000 Delivered-To: apmail-mesos-dev-archive@mesos.apache.org Received: (qmail 3929 invoked by uid 500); 3 Mar 2015 20:26:11 -0000 Mailing-List: contact dev-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mesos.apache.org Delivered-To: mailing list dev@mesos.apache.org Received: (qmail 3909 invoked by uid 99); 3 Mar 2015 20:26:11 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 20:26:11 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 9B6781CAC21; Tue, 3 Mar 2015 20:26:10 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7523819295098782608==" MIME-Version: 1.0 Subject: Re: Review Request 31183: Factored out sum function for Resources. From: "Michael Park" To: "Alexander Rukletsov" , "Benjamin Hindman" , "Ben Mahler" , "Jie Yu" Cc: "mesos" , "Mesos ReviewBot" , "Till Toenshoff" , "Michael Park" , "Alexander Rojas" Date: Tue, 03 Mar 2015 20:26:10 -0000 Message-ID: <20150303202610.12263.62213@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Michael Park" X-ReviewGroup: mesos X-ReviewRequest-URL: https://reviews.apache.org/r/31183/ X-Sender: "Michael Park" References: <20150303072104.12262.67808@reviews.apache.org> In-Reply-To: <20150303072104.12262.67808@reviews.apache.org> Reply-To: "Michael Park" X-ReviewRequest-Repository: mesos --===============7523819295098782608== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/31183/ ----------------------------------------------------------- (Updated March 3, 2015, 8:26 p.m.) Review request for mesos, Alexander Rukletsov, Benjamin Hindman, Ben Mahler, and Jie Yu. Changes ------- Moved `sum` into `Resources`. Bugs: MESOS-2373 https://issues.apache.org/jira/browse/MESOS-2373 Repository: mesos Description ------- This is the start of a patch chain for converting `Resources` to `hashmap` in places where we have an aggregate of resources across multiple slaves. In short, scalar resources aggregate correctly across multiple slaves, but non-scalar resources (e.g. ports) do not aggregate correctly. Please refer to the JIRA ticket for further details. The function `sum` is factored out to facilitate small patches. The following is the strategy and why this function will be useful: (1) Update a variable `resources` in a component (e.g. master) from `Resources` to `hashmap`. (2) For callsites where we pass `resources` to another component (e.g. allocator), we'll pass `sum(resources.values())` instead to preserve the existing behavior in the other component. Diffs (updated) ----- include/mesos/resources.hpp da6d48871a0061d8bbf5e681dd6e7edac659d812 src/master/allocator/mesos/hierarchical.hpp c0b1da75565d9dc7728c5566f01815234163fc47 src/tests/hierarchical_allocator_tests.cpp 93753d1c04159a04a733927a487eb69505438e32 Diff: https://reviews.apache.org/r/31183/diff/ Testing ------- make check Thanks, Michael Park --===============7523819295098782608==--