> On Jan. 6, 2016, 10:09 a.m., Adam B wrote: > > src/master/allocator/mesos/hierarchical.cpp, lines 1048-1051 > > <https://reviews.apache.org/r/41597/diff/36/?file=1183523#file1183523line1048> > > > > Does anything rely on this behavior of erasing 1.0s from the hashmap? I > > know it'll (slightly) reduce the number of bits in memory and persisted in > > the registry, but is there any other reason to do this? Might be a > > premature optimization. Besides, the sorters still get updated for 1.0s. > > Thoughts? > > Yongqiao Wang wrote: > There is no any other reasons for erasing the default weight frm the > hasmap. In HierarchicalAllocatorProcess::roleWeight method of allocator, if > the role's weight does not exist in weights hashmap, then it will return 1.0. > so it is make sence to the erase it. > > In addition, we should keep the same behaviour to only save the > non-default weights in allocator, master and registry. > > Adam B wrote: > I'm all for consistency, but since this behavior doesn't exist anywhere > else (yet), and there's no strong need for it, I'm inclined to follow the > KISS principle and not treat 1.0 updates specially. Let's not erase the 1.0s, > and just update weights[role] just like with any other valid value. > > If it seems like a reasonable speed/space optimization, we can consider > it later for allocator, master, and/or registry. I can't foresee any > backwards compatibility issues if we have to change it later.
OK, agree. - Yongqiao ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41597/#review113035 ----------------------------------------------------------- On Jan. 18, 2016, 8:20 a.m., Yongqiao Wang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41597/ > ----------------------------------------------------------- > > (Updated Jan. 18, 2016, 8:20 a.m.) > > > Review request for mesos, Adam B, Neil Conway, and Qian Zhang. > > > Bugs: MESOS-3943 > https://issues.apache.org/jira/browse/MESOS-3943 > > > Repository: mesos > > > Description > ------- > > Add the interface in allocator to support updating weight > at runtime, and the allocator is invoked to allocate the > resources based on the updated weights later. > > > Diffs > ----- > > include/mesos/master/allocator.hpp e163669c9c4e4c98572968f18987704b60722a79 > include/mesos/mesos.proto 0be4bed336e86a5c377e87ac6212c70ac3b4c66b > include/mesos/v1/mesos.proto c3244e87f9351c71312d2eace7a49bcac926fafd > src/master/allocator/mesos/allocator.hpp > 581eaad376e7b2febe0b6359014617b935a677a3 > src/master/allocator/mesos/hierarchical.hpp > 101482156ffc5a4fe3cd60be222bfe609330ec3c > src/master/allocator/mesos/hierarchical.cpp > 48acde69b1a2f305b568a7e322a58708063dd30a > src/master/allocator/sorter/drf/sorter.hpp > 050896e8b12cd4097ccd137d5284d6b39b0f06ab > src/master/allocator/sorter/drf/sorter.cpp > 3a442f121f3a1505513877a5c78458a4b8d0a824 > src/master/allocator/sorter/sorter.hpp > 7be6b44a762fd62c2cd7f28b4dc4865a4587ed26 > src/tests/allocator.hpp 206e9ac3a83038a691f7929bdd627042b0f363b0 > > Diff: https://reviews.apache.org/r/41597/diff/ > > > Testing > ------- > > Make & Make check successfully! > > Test case: https://reviews.apache.org/r/41672/ > > > Thanks, > > Yongqiao Wang > >
