> On May 28, 2019, 12:24 p.m., Benjamin Mahler wrote: > > src/master/allocator/mesos/hierarchical.cpp > > Lines 1446-1450 (patched) > > <https://reviews.apache.org/r/70716/diff/2/?file=2146870#file2146870line1446> > > > > We could contain this logic a bit more without having the 'limits' > > variable in the top level scope? > > > > ``` > > roles[role].quotaLimits = [&]() { > > protobuf::Map<string, Value::Scalar> limits; > > foreach (const Resource& r, quota.info.guarantee()) { > > limits[r.name()] = r.scalar(); > > } > > return ResourceLimits(limits); > > }(); > > ```
Sounds good. Thanks. - Meng ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/70716/#review215551 ----------------------------------------------------------- On May 29, 2019, 9:48 a.m., Meng Zhu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/70716/ > ----------------------------------------------------------- > > (Updated May 29, 2019, 9:48 a.m.) > > > Review request for mesos, Andrei Sekretenko and Benjamin Mahler. > > > Repository: mesos > > > Description > ------- > > Currently, resource quota acts as both guarantees and limits. > This patch adds a field `quotaLimits` in the role struct. > This paves the way for enforcing guarantees and limits > separately in the allocator. > > Also added a helper `getLimits` to look up quota limits of a > given role. > > > Diffs > ----- > > src/master/allocator/mesos/hierarchical.hpp > 71a9656fb934bf9ac58e3165254ea49cb09efa8b > src/master/allocator/mesos/hierarchical.cpp > 40c8363afddccdd5275ca06318a8cc2cc6fa21af > > > Diff: https://reviews.apache.org/r/70716/diff/3/ > > > Testing > ------- > > make check > > > Thanks, > > Meng Zhu > >
