----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/39018/#review102443 -----------------------------------------------------------
The documentation added in this patch is great! Also consider breaking it out to a separate patch to separate behavioral vs non-behavioral changes. It really helps whoever's reviewing to stay within a narrower context :) include/mesos/resources.hpp (lines 69 - 70) <https://reviews.apache.org/r/39018/#comment160111> `s/name and role/name, value, and role/` include/mesos/resources.hpp (lines 75 - 76) <https://reviews.apache.org/r/39018/#comment160112> `s/parsing is successful/parsing was successful/` `s/an Error if it isn't/an Error otherwise/` include/mesos/resources.hpp (lines 92 - 93) <https://reviews.apache.org/r/39018/#comment160113> Same comment as above. include/mesos/v1/resources.hpp (lines 350 - 414) <https://reviews.apache.org/r/39018/#comment160145> Could you explain why these can't simply live in `resources.cpp` as implementation details? Do we actually refer to private parts of the `Resource` object within these functions? src/common/resources.cpp (line 361) <https://reviews.apache.org/r/39018/#comment160146> I think it would be better to only support one way of doing things here. I would opt for the array format. Is supporting both formats explicitly a feature? src/common/resources.cpp (lines 392 - 393) <https://reviews.apache.org/r/39018/#comment160147> Why the wrapping here? src/common/resources.cpp (lines 515 - 516) <https://reviews.apache.org/r/39018/#comment160148> This fits in one line now. src/common/resources.cpp (lines 601 - 602) <https://reviews.apache.org/r/39018/#comment160149> This fits in one line now. src/common/resources.cpp (line 1156) <https://reviews.apache.org/r/39018/#comment160153> Why the move here? - Michael Park On Oct. 12, 2015, 6:38 p.m., Greg Mann wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/39018/ > ----------------------------------------------------------- > > (Updated Oct. 12, 2015, 6:38 p.m.) > > > Review request for mesos, Adam B, Alexander Rukletsov, Jie Yu, and Michael > Park. > > > Bugs: MESOS-2467 > https://issues.apache.org/jira/browse/MESOS-2467 > > > Repository: mesos > > > Description > ------- > > This includes code changes necessary for JSON parsing of Resources. > Documentation changes will be posted soon in another review > (https://reviews.apache.org/r/39102/). > > > Diffs > ----- > > include/mesos/resources.hpp 6c3a065945eb56dc88df9c977e5ca11d4cbcbf61 > include/mesos/v1/resources.hpp fe8925ac851b74d1b37919f00afc7ed816f47ea5 > src/common/resources.cpp 601388c35a1bff37c58e753d1870d53b8d0af2d1 > src/tests/resources_tests.cpp 6584fc6c39e6ffe9f8085576677dcc669f127697 > src/v1/resources.cpp dc868903472f8f3a1ddc56092e3f8f81d953ce39 > > Diff: https://reviews.apache.org/r/39018/diff/ > > > Testing > ------- > > New code was added to `ResourcesTest.ParsingFromJSON`, and two new tests were > added: `ResourcesTest.ParsingFromJSONWithRoles` and > `ResourcesTest.ParsingFromJSONError`. These attempt to test common error > scenarios that might show up in user-supplied JSON. > > `make check` was used to confirm that all tests pass, with one notable > failure (ResourcesTest.ParsingFromJSONError) related to a picojson issue > tracked here: https://issues.apache.org/jira/browse/MESOS-3698 > > The original resources parsing format is used throughout many other tests > (check `src/tests/sorter_tests.cpp`, for example), so it's clear that the > original parsing continues to work correctly. > > > Thanks, > > Greg Mann > >
