> On July 20, 2016, 2:36 a.m., Klaus Ma wrote: > > src/common/resources.cpp, lines 308-316 > > <https://reviews.apache.org/r/45959/diff/8/?file=1447680#file1447680line308> > > > > I think we can check name,type, role firstly, then check SharedInfo.
Although I updated it based on your comment, I think it was not needed since `left == right` does those checks. I will revert it in the next update. - Anindya ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45959/#review142892 ----------------------------------------------------------- On July 28, 2016, 10:42 p.m., Anindya Sinha wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45959/ > ----------------------------------------------------------- > > (Updated July 28, 2016, 10:42 p.m.) > > > Review request for mesos, Benjamin Mahler, Joris Van Remoortere, and Jiang > Yan Xu. > > > 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 > ----- > > include/mesos/resources.hpp 88a9feabf66ed34e7e5b1c6cb7e831818e7f7883 > src/common/resources.cpp 3dbff24d6859d3b1ed8589cec50170a5202cfbcb > 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 > >
