> On 九月 19, 2016, 6 a.m., Guangya Liu wrote: > > src/slave/containerizer/containerizer.cpp, lines 64-71 > > <https://reviews.apache.org/r/51999/diff/1/?file=1501131#file1501131line64> > > > > A question here: Does the `resources` here will include the zero value > > resource? > > > > If so, what is the differencen of this code block and > > `Resources::parse()`? The `Resources::parse()` seems similar as here. > > Anindya Sinha wrote: > The original code returns a `Resources` which contains individual > `Resource` objects, which removes any empty `Resource` objects > (https://github.com/apache/mesos/blob/master/src/common/resources.cpp#L1610). > Since we need to know of empty `Resource` objects for this patch, we > actually accumulate the `Resource` objects in a `vector<Resource>` (which > will contain any empty `Resource` object) which is used when disk resources > are present (to check for scalar value of 0 for the auto detection logic). > But for the rest of the resources, we do a `Resources resources = > parsed.get();` which implicitly converts a `vector<Resource>` to `Resources` > which removes the empty `Resource` objects.
I see, that's why this update makes me confused: You are actually doing the same thing as `Resources::parse()` here. I think that it is not good to put the update here but merge this to https://reviews.apache.org/r/51879/diff/3#index_header , comments? - Guangya ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51999/#review149431 ----------------------------------------------------------- On 九月 19, 2016, 10:42 p.m., Anindya Sinha wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/51999/ > ----------------------------------------------------------- > > (Updated 九月 19, 2016, 10:42 p.m.) > > > Review request for mesos and Jiang Yan Xu. > > > Bugs: MESOS-6062 > https://issues.apache.org/jira/browse/MESOS-6062 > > > Repository: mesos > > > Description > ------- > > During parsing of resources in the startup flags of mesos agent, all > the valid resources (including empty resources) are accumulated in a > vector of Resource protobufs. > > > Diffs > ----- > > include/mesos/resources.hpp 3ef8cacee529addc745b4aeb6398d7606c61b749 > include/mesos/v1/resources.hpp ef56b4960b103a3efd916fab64796aa334ba44c6 > src/common/resources.cpp 4602bff22ec7ff77f069056085ad92bfa04595f3 > src/slave/containerizer/containerizer.cpp > d46882baa904fd439bffb23c324828b777228f1c > src/tests/resources_tests.cpp 3e493007d6d1d8194d07035aaa1cde28dedf2b5a > src/v1/resources.cpp 7c4db44d4c31a8295cc16b0ce1ef5adf314e6ac6 > > Diff: https://reviews.apache.org/r/51999/diff/ > > > Testing > ------- > > > Thanks, > > Anindya Sinha > >