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 Fri, 29 Apr 2016 00:15:40 GMT

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

(Updated April 29, 2016, 12:15 a.m.)

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


Refactored to not expose shareCount within `Resource_`.

Bugs: MESOS-4892

Repository: mesos

Description (updated)

A new class Resoure_ is added to keep track of Resource and its
consumer count. As a result, Resources maintains a single container
for all resources.

All resources have consumer counts that is tracked within Resources. For
resource addition and subtraction, the consumer counts are adjusted for
shared resources as follows:
a) Addition: If shared resource is absent from original, then the
   resource is added with a consumer count of 0. Otherwise, the consumer
   count for the shared resource is incremented by 1.
b) Subtraction: If shared resource's consumer count is already 0, then
   the shared resource is removed from the original. Otherwise, its
   consumer count is decremented by 1.

Diffs (updated)

  include/mesos/resources.hpp a557e97c65194d4aad879fb88d8edefd1c95b8d8 
  include/mesos/v1/resources.hpp a5ba8fec4c9c3643646308f75a4b28cefe0b3df3 
  src/common/resources.cpp f6ff92b591c15bc8e93fd85e1896349c3a7bb968 
  src/master/validation.cpp f458100d22ec1f9f10921c1c91b6931a5671e28f 
  src/tests/mesos.hpp 0f6f541c5d2007a69ad5bd6e884235cd3c0c1be2 
  src/tests/resources_tests.cpp dc12bd8f1e2da6972bc8aed598811c55d664036e 
  src/v1/resources.cpp 8c3f2d1c1529915a59d47fe37bb3fc7a3267079a 



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