> On Nov. 19, 2015, 10:39 a.m., Alexander Rukletsov wrote: > > src/master/quota_handler.cpp, line 195 > > <https://reviews.apache.org/r/39492/diff/3/?file=1126166#file1126166line195> > > > > Am I right that there is another way to achieve the same: > > ``` > > status.mutable_guarantees()->Add()->CopyFrom(quotaInfo.info); > > ``` > > > > Do you know what the difference is and what approach is preferable?
Afaik they are equivalent. I would use Add() in cases where have the object anyhow and do not have to get it via mutable_X(). See for example in resources.cpp "resources.Add()->CopyFrom(that)". In cases where I only have access to a sorrounding object (i.e status in this case) I use add_x(). - Joerg ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/39492/#review107157 ----------------------------------------------------------- On Nov. 16, 2015, 1:13 p.m., Joerg Schad wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/39492/ > ----------------------------------------------------------- > > (Updated Nov. 16, 2015, 1:13 p.m.) > > > Review request for mesos, Alexander Rukletsov, Bernd Mathiske, and Joris Van > Remoortere. > > > Bugs: MESOS-3073 > https://issues.apache.org/jira/browse/MESOS-3073 > > > Repository: mesos > > > Description > ------- > > Added status handling for quota master endpoint. > Tests are in next Review. > > > Diffs > ----- > > include/mesos/quota/quota.proto 4e4d8ccc92e2bf9a8e5eae8488c0c952f82fdd6d > src/master/master.hpp ead8520b7108a0f2c3a0bb11ae7b543897d111a2 > src/master/quota_handler.cpp PRE-CREATION > > Diff: https://reviews.apache.org/r/39492/diff/ > > > Testing > ------- > > Test output: > {"quota":[{"guarantee":{"cpus":4.0,"disk":0,"mem":5.0},"role":"test"}]} > > > Thanks, > > Joerg Schad > >