> On Feb. 19, 2016, 9:31 a.m., Alexander Rukletsov wrote: > > src/tests/hierarchical_allocator_tests.cpp, lines 2423-2433 > > <https://reviews.apache.org/r/41672/diff/12/?file=1203046#file1203046line2423> > > > > Will it be cleaner to put resources from the allocation into a hashmap > > by framework id? I think this way you can even get rid of the loop. > > > > Same suggestions for the section below. > > Yongqiao Wang wrote: > Personallly, the current implementation is cleaner, if we using a loop > for this, we also need to check the framework Id in the loop due to there > allocation size and resources are different. > > Adam B wrote: > Not to mention that you still have to call `allocations.get()` each time. > And you'd have to have two hashmaps, one for allocation size and another for > resources, or create a struct to hold both. I don't see how you could do it > without the loop unless you unroll the loop or hide it behind a lambda. I > don't think we need to change the implementation here. Dropping the issue.
For posterity, I've explained what I meant in https://reviews.apache.org/r/43824/#comment183415 - Alexander ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41672/#review119839 ----------------------------------------------------------- On Jan. 20, 2016, 8:36 a.m., Yongqiao Wang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41672/ > ----------------------------------------------------------- > > (Updated Jan. 20, 2016, 8:36 a.m.) > > > Review request for mesos, Adam B, Neil Conway, and Qian Zhang. > > > Bugs: MESOS-4200 > https://issues.apache.org/jira/browse/MESOS-4200 > > > Repository: mesos > > > Description > ------- > > Test case(s) for weights + allocation behaviour. > > > Diffs > ----- > > src/tests/hierarchical_allocator_tests.cpp > 953712149bd951789beb29c72779c4ac65aa48dc > > Diff: https://reviews.apache.org/r/41672/diff/ > > > Testing > ------- > > Make check done: > $ ./src/mesos-tests --gtest_filter=HierarchicalAllocatorTest.UpdateWeight > Source directory: /Users/yqwyq/Desktop/mesos > Build directory: /Users/yqwyq/Desktop/mesos/build > [==========] Running 1 test from 1 test case. > [----------] Global test environment set-up. > [----------] 1 test from HierarchicalAllocatorTest > [ RUN ] HierarchicalAllocatorTest.UpdateWeight > [ OK ] HierarchicalAllocatorTest.UpdateWeight (87 ms) > [----------] 1 test from HierarchicalAllocatorTest (87 ms total) > > [----------] Global test environment tear-down > [==========] 1 test from 1 test case ran. (176 ms total) > [ PASSED ] 1 test. > > > Thanks, > > Yongqiao Wang > >