> On July 23, 2016, 1:37 a.m., Benjamin Mahler wrote: > > Thanks Jacob! I left some comments here around style and readability of the > > code. It looks like much of this was copied and so I realize that you > > weren't the one to introduce many of these patterns. Nonetheless, would be > > great to simplify this!
Thanks for the review Ben! Your comments are definitely apropos and very helpful for my own understanding. > On July 23, 2016, 1:37 a.m., Benjamin Mahler wrote: > > src/tests/hierarchical_allocator_tests.cpp, lines 3579-3581 > > <https://reviews.apache.org/r/49616/diff/4/?file=1439839#file1439839line3579> > > > > I'm confused by this comment, why is this relevant if the clock is > > paused? Advancing the clock by the default allocation_interval triggers the batch allocate, I agree this is not relevant. > On July 23, 2016, 1:37 a.m., Benjamin Mahler wrote: > > src/tests/hierarchical_allocator_tests.cpp, lines 3649-3652 > > <https://reviews.apache.org/r/49616/diff/4/?file=1439839#file1439839line3649> > > > > Per my comment above, it seems much easier to understand this code if > > we just loop on the number of allocations we expect: > > > > ``` > > size_t allocationsCount = 5; > > size_t suppressCount = 0; > > > > for (size_t i = 0; i < allocationsCount; ++i) { > > ... > > > > // Suppress another batch of frameworks. > > for (size_t j = 0; j < frameworkCount / allocationsCount; ++j) { > > allocator->suppressOffers(frameworks[suppressCount].id()); > > ++suppressCount; > > } > > > > ... > > } > > ``` I agree this is easier to understand and simpler if we loop by the expected counts. - Jacob ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/49616/#review143308 ----------------------------------------------------------- On July 26, 2016, 5:29 a.m., Jacob Janco wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/49616/ > ----------------------------------------------------------- > > (Updated July 26, 2016, 5:29 a.m.) > > > Review request for mesos, James Peach, Joris Van Remoortere, and Jiang Yan Xu. > > > Bugs: MESOS-5781 > https://issues.apache.org/jira/browse/MESOS-5781 > > > Repository: mesos > > > Description > ------- > > - Useful for high framework clusters which carry > many suppressed frameworks that are considered > during allocation. > > > Diffs > ----- > > docs/contributors.yaml b8ecdad2591ba5ee0de50e970b7276587db22270 > src/tests/gc_tests.cpp 11a31dbb8d12bfb8a7f10c8eb87154289ac96f62 > src/tests/hierarchical_allocator_tests.cpp > 0498cd5e54b0e4b87a767585a77699653aa52179 > > Diff: https://reviews.apache.org/r/49616/diff/ > > > Testing > ------- > > MESOS_BENCHMARK=1 GTEST_FILTER="*BENCHMARK_Test.SuppressOffers*" make check > > > Thanks, > > Jacob Janco > >
