----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/54830/#review159556 -----------------------------------------------------------
Fix it, then Ship it! Thanks! include/mesos/resources.hpp (lines 377 - 378) <https://reviews.apache.org/r/54830/#comment230589> Maybe a comment that this must be called only on allocated resources, since this will otherwise crash the program via the CHECK. include/mesos/v1/resources.hpp (lines 377 - 378) <https://reviews.apache.org/r/54830/#comment230590> Ditto here. src/tests/resources_tests.cpp (lines 2756 - 2772) <https://reviews.apache.org/r/54830/#comment230591> I'll send you a review I have to add `Resources::allocate` and `Resources::unallocate`, this will let us avoid having a special helper here (for now we can just add a TODO here and I'll clean it up in my patch). src/tests/resources_tests.cpp (lines 2765 - 2769) <https://reviews.apache.org/r/54830/#comment230592> Hm.. I didn't follow this assumption, I guess when you're saying "using star role" you're referring to unreserved resources? src/v1/resources.cpp (line 34) <https://reviews.apache.org/r/54830/#comment230593> Since we already have <glog/logging.h> we have CHECK available, <stout/check> introduces CHECK_SOME, CHECK_NONE, CHECK_ERROR. - Benjamin Mahler On Dec. 17, 2016, 1:24 p.m., Guangya Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/54830/ > ----------------------------------------------------------- > > (Updated Dec. 17, 2016, 1:24 p.m.) > > > Review request for mesos, Benjamin Mahler and Jay Guo. > > > Repository: mesos > > > Description > ------- > > Added helper function to get per-role resource allocations. > > > Diffs > ----- > > include/mesos/resources.hpp f569c931ff7db8d51dfd7c96f4f2addab05df85d > include/mesos/v1/resources.hpp f60ab794a0c7c24885c49cc47b798c363e3279e7 > src/common/resources.cpp 4bb9beffcb3509f4226b4985e05eccec01412d0f > src/tests/resources_tests.cpp d6eb7787bac58c1133a4bab0fc17df49117fed87 > src/v1/resources.cpp 46cc00f2f453f5eb4ddc4b0b9b89be2bd89f05d9 > > Diff: https://reviews.apache.org/r/54830/diff/ > > > Testing > ------- > > make > make check > > ``` > ./bin/mesos-tests.sh --gtest_filter="AllocatedResourcesTest.Allocations" > --verbose > [==========] Running 1 test from 1 test case. > [----------] Global test environment set-up. > [----------] 1 test from AllocatedResourcesTest > [ RUN ] AllocatedResourcesTest.Allocations > [ OK ] AllocatedResourcesTest.Allocations (0 ms) > [----------] 1 test from AllocatedResourcesTest (0 ms total) > > [----------] Global test environment tear-down > [==========] 1 test from 1 test case ran. (17 ms total) > [ PASSED ] 1 test. > ``` > > > Thanks, > > Guangya Liu > >
