----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58110/#review170783 -----------------------------------------------------------
Doesn't this patch also warrant avoiding the copying of the Client struct? This patch on its own seems to incur a lot of extra expense if we don't don't do the change to pointers here. - Benjamin Mahler On March 31, 2017, 8:59 p.m., Neil Conway wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58110/ > ----------------------------------------------------------- > > (Updated March 31, 2017, 8:59 p.m.) > > > Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Michael Park. > > > Repository: mesos > > > Description > ------- > > The sorter previously managed three collections: a set of active > clients, a map from client names to allocations, and a map from client > names to weights. Since the set previously contained only active > clients, each client's allocation needed to be stored separately, since > the sorter needed to remember the allocation made to inactive clients. > > Now that the set of clients includes both active and inactive clients, > we can dispense with the additional `allocations` map and store a > client's allocation as a nested struct in the `Client` struct. This > avoids the need to keep the two collections synchronized; the logic for > manipulating allocations is also more properly written as a member > function of the Client::Allocation struct, rather than inline in a > member function of DRFSorter. > > > Diffs > ----- > > src/master/allocator/sorter/drf/metrics.cpp > 15aab32db5ca1a7a14080e9bbb7c65283be3ec20 > src/master/allocator/sorter/drf/sorter.hpp > 76329220e1115c1de7810fb69b943c78c078be59 > src/master/allocator/sorter/drf/sorter.cpp > ed54680cecb637931fc344fbcf8fd3b14cc24295 > > > Diff: https://reviews.apache.org/r/58110/diff/3/ > > > Testing > ------- > > `make check` > > > Thanks, > > Neil Conway > >
