----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/70161/#review213567 -----------------------------------------------------------
src/master/quota.cpp Lines 316-334 (patched) <https://reviews.apache.org/r/70161/#comment299540> Is it possible to re-use a generic Value::Scalar input validator instead of defining inline? src/master/quota.cpp Lines 328-331 (patched) <https://reviews.apache.org/r/70161/#comment299539> Maybe also check isnormal? src/master/quota.cpp Lines 340 (patched) <https://reviews.apache.org/r/70161/#comment299541> Can we include in the error string which guarantee is invalid? src/master/quota.cpp Lines 348 (patched) <https://reviews.apache.org/r/70161/#comment299542> Ditto here for which limit is invalid? src/master/quota.cpp Lines 352-366 (patched) <https://reviews.apache.org/r/70161/#comment299543> Could this be written as: ``` ResourceLimits limits = x; ResourceQuantities guarantee = y; if (!limits.contains(guarantee)) { // error } ``` That way, we could consider just unit testing one contains issue for this function and rely on the .contains test for being more comprehensive? - Benjamin Mahler On March 8, 2019, 7:25 a.m., Meng Zhu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/70161/ > ----------------------------------------------------------- > > (Updated March 8, 2019, 7:25 a.m.) > > > Review request for mesos and Benjamin Mahler. > > > Bugs: MESOS-9596 > https://issues.apache.org/jira/browse/MESOS-9596 > > > Repository: mesos > > > Description > ------- > > A `QuotaConfig` is valid if the following conditions are met: > > (1) The config has a valid non-"*" role. > > (2) Resource scalar values are non-negative and finite. > > (3) If both guarantees and limits are set for a particular > resource, then guarantee <= limit for that resource. > > > Diffs > ----- > > src/master/quota.hpp 5cd2bb0e8669ee0290a4c1fe1058b87251772939 > src/master/quota.cpp 671626c01ada595d7557d5266e39a17cce243b94 > > > Diff: https://reviews.apache.org/r/70161/diff/1/ > > > Testing > ------- > > make check > dedicated test added in subsequent patches > > > Thanks, > > Meng Zhu > >
