----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41847/#review114832 -----------------------------------------------------------
Test looks good. Just a suggestion: src/master/allocator/mesos/hierarchical.cpp (lines 529 - 535) <https://reviews.apache.org/r/41847/#comment175684> What if you did this? ``` slaves[slaveId]total = slaves[slaveId].total.nonUsageSlack() + oversubscribed; ``` Where `nonUsageSlack` is a helper that filters out usage slack. (You could just use a Resource filter directly here.) --- This would have fewer operations too (1 filter operation instead of 2). - Joseph Wu On Jan. 13, 2016, 4:55 a.m., Guangya Liu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41847/ > ----------------------------------------------------------- > > (Updated Jan. 13, 2016, 4:55 a.m.) > > > Review request for mesos, Ben Mahler, Artem Harutyunyan, Joris Van > Remoortere, Joseph Wu, Klaus Ma, and Jian Qiu. > > > Bugs: MESOS-4145 > https://issues.apache.org/jira/browse/MESOS-4145 > > > Repository: mesos > > > Description > ------- > > Updated allocation slack when slave was updated. > > > Diffs > ----- > > src/master/allocator/mesos/hierarchical.cpp > d541bfa3f4190865c65d35c9d1ffdb8a3f194056 > src/tests/hierarchical_allocator_tests.cpp > e044f832c2c16e53e663c6ced5452649bb0dcb59 > > Diff: https://reviews.apache.org/r/41847/diff/ > > > Testing > ------- > > make > make check > GLOG_v=2 ./bin/mesos-tests.sh --gtest_filter="HierarchicalAllocatorTest.*" > --verbose > > > Thanks, > > Guangya Liu > >