> On Feb. 12, 2014, 11:40 p.m., Ben Mahler wrote: > > src/master/http.cpp, lines 93-96 > > <https://reviews.apache.org/r/17976/diff/1/?file=483103#file483103line93> > > > > We should definitely implement the aggregation since roles are not > > unique across resources. > > > > What about just pulling out the role object above when it already > > exists? > > > > JSON::Object role; > > if (object.values.count(resource.role()) > 0) { > > role = object.values[resource.role()]; > > } > > > > ... > > > > object.values[resource.role()] = role; > > Dominic Hamon wrote: > it's not that simple. In the case of a scalar you'd then need to add the > value. In the case of a range, you'd need to update the min/max, etc. > > But yes, i'll make this change too now i've seen the webui causing the > warning to be logged :)
Can you clarify why you need to do this kind of merging? Aren't the resource names different for a particular role? (That we should be enforcing, if not already). - Ben ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/17976/#review34328 ----------------------------------------------------------- On Feb. 12, 2014, 11:04 p.m., Dominic Hamon wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/17976/ > ----------------------------------------------------------- > > (Updated Feb. 12, 2014, 11:04 p.m.) > > > Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone. > > > Bugs: MESOS-692 > https://issues.apache.org/jira/browse/MESOS-692 > > > Repository: mesos-git > > > Description > ------- > > See summary. > > old format of master/state.json: > {... > "slaves":[... > "resources":{"ports":"[31000-32000]"}} > ...] > ...} > > new format: > {... > "slaves":[... > "resources":{"*":{"ports":"[31000-32000]"}}} > ...] > ...} > > There is an assumption that there is each resource has a unique role. If this > is not the case (ie, if there are multiple resources with the role '*' a > warning is emitted. The solution for this is to correctly handle merging of > resources with the same role. > > > Diffs > ----- > > src/master/http.cpp 966eed6d8340038265ef799f1b6149502ccc606e > src/slave/http.cpp c4f598faf6807214608cc89a6d9cf665133f95f3 > > Diff: https://reviews.apache.org/r/17976/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Dominic Hamon > >