> On 一月 19, 2016, 10:18 p.m., Joseph Wu wrote: > > src/common/resources.cpp, lines 874-877 > > <https://reviews.apache.org/r/41772/diff/6/?file=1199181#file1199181line874> > > > > This is pretty much a copy of `Resources::reserved` now. You can > > remove it. > > Guangya Liu wrote: > The reason that I keep this is because the current `Resources::reserved` > returns a hashmap but what I need here is a flatten string for resources in > different roles. e.g. cpus(r1):100;cpus(r2):200 > > I updated the comments here to clarify why this is needed. > > Klaus Ma wrote: > I think it's more general to add a `Resources` constructor to accept > hashmap, so it'll be `Resources(res.reserved()).flatten()`. > > Joseph Wu wrote: > It doesn't look like `reserved()` is used very heavily. And the places > that do use it could easily use a normal `Resources` object. I'd recommend > changing `reserved()` or just using `reserved("*")`.
I created a new patch here https://reviews.apache.org/r/42590/ , can you help review? I think that the `reserved()` API can be removed. - Guangya ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41772/#review115249 ----------------------------------------------------------- On 一月 20, 2016, 3:40 a.m., Guangya Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41772/ > ----------------------------------------------------------- > > (Updated 一月 20, 2016, 3:40 a.m.) > > > Review request for mesos, Ben Mahler, Artem Harutyunyan, Joris Van > Remoortere, Joseph Wu, and Klaus Ma. > > > Bugs: MESOS-4267 > https://issues.apache.org/jira/browse/MESOS-4267 > > > Repository: mesos > > > Description > ------- > > Added helper function to flatten resources. > > > Diffs > ----- > > include/mesos/resources.hpp cc8fef9470d779078aa408ed03e747e5a492deaa > include/mesos/v1/resources.hpp f4892977f8d7b0439db6e9cf7921334f606a496c > src/common/resources.cpp 575d6651185d8431f01d589f4afc255cb751181a > src/tests/resources_tests.cpp b42610f1bf8eacfd7bf388d351f8745f1d96f666 > src/v1/resources.cpp 8de6672ba9b34947db81c74b8e03e8965e8af5fc > > Diff: https://reviews.apache.org/r/41772/diff/ > > > Testing > ------- > > make > make check > > GLOG_v=2 ./bin/mesos-tests.sh --gtest_filter="ResourcesOperationTest.*" > --verbose > > > Thanks, > > Guangya Liu > >