mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anindya Sinha <>
Subject Re: Review Request 45959: Support arithmetic operations for shared resources with consumer counts.
Date Thu, 21 Jul 2016 00:12:15 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated July 21, 2016, 12:12 a.m.)

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


updates based on review comments.

Bugs: MESOS-4892

Repository: mesos


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 a557e97c65194d4aad879fb88d8edefd1c95b8d8 
  src/common/resources.cpp b1bd2784aefdebf91892638b40b215373b998574 
  src/master/validation.cpp 52002beac29c371411348cb026a216e99ac96ab2 
  src/tests/mesos.hpp e4eccfc3810bed3649a3ab80e252849470de4c72 
  src/tests/resources_tests.cpp 4111e080b84079e100b731c9a56861b204f17388 



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


Anindya Sinha

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