> On Aug. 26, 2020, 11:28 p.m., Benjamin Mahler wrote: > > src/master/allocator/mesos/offer_constraints_filter.hpp > > Lines 27 (patched) > > <https://reviews.apache.org/r/72786/diff/7/?file=2238780#file2238780line27> > > > > Hm.. why is this decoupled into a different header from > > OfferConstraintsFilter? Is it to minimize the stuff pulled into master.hpp? > > If so, not sure if that's worth the extra indirection? > > Andrei Sekretenko wrote: > Right at this moment, this also helps minimize things that are kept in > the public header `<mesos/allocator/allocator.hpp>` (which, for example, is > included into something like 1/3 of the volume of our tests, directly or > indirectly). > > Benjamin Mahler wrote: > Oh, just to minimize the content of `<mesos/allocator/allocator.hpp>`? > We're only saving 1 small struct here, doesn't seem worth it? Or have you > seen it actually make a difference in compile times? > > I would suspect we have better low hanging fruit for improving compile > times more generally?
This is not a question of a clean compile time but of a recompile time. When any change in the filter creation interface - an internal interface which is absolutely of no concern to the code that mocks `TestAllocator` and mostly of no concern to all the other stuff that includes `allocator.hpp` - results in recompiling 1/4 of the project, this just does not look right. Sure, we have a very similar issue with protobufs. However, protobufs are by design essentially append-only, which is not the case with the interfaces internal to Mesos (or, at least, should not be the case). Overall, in the public headers we have around 140 non-protobuf class/struct definitions, most of which are really needed there (used by modules/schedulers). -- On the other hand, the construction interface will probably end up converted into a factory-like entity in future. Given that this is likely to happen before we add more options, I'm inclined to stop thinking about this particular case and just define `struct Options` in this header, but leave a TODO for pulling the construction interface away from the public header in case we find ourselves adding more options and this `struct Options` is still here. - Andrei ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/72786/#review221727 ----------------------------------------------------------- On Aug. 27, 2020, 11:52 a.m., Andrei Sekretenko wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/72786/ > ----------------------------------------------------------- > > (Updated Aug. 27, 2020, 11:52 a.m.) > > > Review request for mesos and Benjamin Mahler. > > > Bugs: MESOS-10173 > https://issues.apache.org/jira/browse/MESOS-10173 > > > Repository: mesos > > > Description > ------- > > Implemented regex-based offer constraints. > > > Diffs > ----- > > include/mesos/allocator/allocator.hpp > 05d0e9c46485c3048a65d46747d56e715883a0b3 > src/Makefile.am 8b95611baff2f925910ea46addf462cf9f33071b > src/master/allocator/mesos/offer_constraints_filter.hpp PRE-CREATION > src/master/allocator/mesos/offer_constraints_filter.cpp > d724fd0a9832feea26f6db1a498b6bdee83ffff0 > src/master/constants.hpp c384b6878193a4b6bb09294d8b14757906595c1b > src/master/flags.hpp 78623d68bf428cd3f52684303d98a525d42eb878 > src/master/flags.cpp 74f4daadd48e8e691be43759b88dc8b3c2df489a > src/master/master.hpp e478f805069813532011f2a1991ab1f847080516 > src/master/master.cpp 4428985902512eea1c97205f04a4fed6c16d494e > src/tests/master/offer_constraints_filter_tests.cpp > 84a1e917a52d0b98f979e454c2b982c6402b0176 > > > Diff: https://reviews.apache.org/r/72786/diff/9/ > > > Testing > ------- > > > Thanks, > > Andrei Sekretenko > >
