mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anindya Sinha <anindya_si...@apple.com>
Subject Re: Review Request 45959: Support arithmetic operations for shared resources with consumer counts.
Date Sat, 30 Jul 2016 06:59:31 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45959/
-----------------------------------------------------------

(Updated July 30, 2016, 6:59 a.m.)


Review request for mesos, Benjamin Mahler, Joris Van Remoortere, and Jiang Yan Xu.


Changes
-------

Rebased with master.


Bugs: MESOS-4892
    https://issues.apache.org/jira/browse/MESOS-4892


Repository: mesos


Description
-------

A new class Resource_ is added that allows 'Resources' to group
identical shared resource objects together into a single 'Resource_'
object and tracked by its shared count. Non-shared resource objects
are not grouped.

For resource addition and subtraction, the shared count is adjusted for
shared resources as follows:
a) Addition: If shared resource is absent from original, then the
   resource is added initialized with a consumer count of 1. Otherwise,
   the share count for the shared resource is incremented.
b) Subtraction: If shared resource's share count is already 1, then
   the shared resource is removed from the original. Otherwise, its
   consumer count is decremented.

Note that v1 changes for shared resources are in the next commit.


Diffs (updated)
-----

  include/mesos/resources.hpp 6638c8f79e45c0ff3efa4342e30478d2e1e4740b 
  src/common/resources.cpp 468581da550bcabf44fbaba8897d5fbbc330c2cb 
  src/master/validation.cpp 52002beac29c371411348cb026a216e99ac96ab2 
  src/tests/mesos.hpp 51c66f175c80ebacd5af230222ea7e4c81dfc1e8 
  src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 

Diff: https://reviews.apache.org/r/45959/diff/


Testing
-------

New tests added to demonstrate arithmetic operations for shared resources with consumer counts.
Tests successful.


Thanks,

Anindya Sinha


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message