You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Michael Park <mp...@apache.org> on 2016/12/14 21:30:53 UTC

Re: Review Request 54017: Changed implementation of LinkedHashMap.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54017/#review159225
-----------------------------------------------------------


Fix it, then Ship it!





3rdparty/stout/include/stout/linkedhashmap.hpp (lines 32 - 34)
<https://reviews.apache.org/r/54017/#comment230166>

    Let's get rid of the `typedef`s here


- Michael Park


On Nov. 23, 2016, 1:33 p.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54017/
> -----------------------------------------------------------
> 
> (Updated Nov. 23, 2016, 1:33 p.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-6626
>     https://issues.apache.org/jira/browse/MESOS-6626
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> LinkedHashMap<Key, Value> used two containers: a std::list<Key> and a
> hashmap<Key, std::pair<Value, std::list<Key>::iterator>>. That approach
> worked fine, but it made it difficult to support iterating over the
> key-value pairs in the map without jumping through hoops or copying.
> 
> Instead, this commit uses a std::list<std::pair<Key, Value>> and a
> hashmap<Key, std::list<std::pair<Key, Value>>::iterator>. This makes it
> easy to support iterating over the entries in the map in insertion
> order: we can just iterate over the list.
> 
> This commit just changes the implementation of LinkedHashMap; support
> for iteration will be added in a subsequent commit.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/linkedhashmap.hpp f48cc5933f9a786be325f71c83151376d1ffe844 
>   3rdparty/stout/tests/linkedhashmap_tests.cpp 376462d1b472586f1547512e6e0a1646c4f76a44 
> 
> Diff: https://reviews.apache.org/r/54017/diff/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Neil Conway
> 
>


Re: Review Request 54017: Changed implementation of LinkedHashMap.

Posted by Neil Conway <ne...@gmail.com>.

> On Dec. 14, 2016, 9:30 p.m., Michael Park wrote:
> > 3rdparty/stout/include/stout/linkedhashmap.hpp, lines 32-34
> > <https://reviews.apache.org/r/54017/diff/2/?file=1569581#file1569581line32>
> >
> >     Let's get rid of the `typedef`s here

`LinkedHashMap` previously used these `typedef`s, and the current `Cache` implementation also uses similar `typedef`s. I don't particularly care whether we use them or not, but I'd opt for deferring this to a separate change (and if we do change it, to also change `Cache`).


- Neil


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54017/#review159225
-----------------------------------------------------------


On Nov. 23, 2016, 9:33 p.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54017/
> -----------------------------------------------------------
> 
> (Updated Nov. 23, 2016, 9:33 p.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-6626
>     https://issues.apache.org/jira/browse/MESOS-6626
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> LinkedHashMap<Key, Value> used two containers: a std::list<Key> and a
> hashmap<Key, std::pair<Value, std::list<Key>::iterator>>. That approach
> worked fine, but it made it difficult to support iterating over the
> key-value pairs in the map without jumping through hoops or copying.
> 
> Instead, this commit uses a std::list<std::pair<Key, Value>> and a
> hashmap<Key, std::list<std::pair<Key, Value>>::iterator>. This makes it
> easy to support iterating over the entries in the map in insertion
> order: we can just iterate over the list.
> 
> This commit just changes the implementation of LinkedHashMap; support
> for iteration will be added in a subsequent commit.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/linkedhashmap.hpp f48cc5933f9a786be325f71c83151376d1ffe844 
>   3rdparty/stout/tests/linkedhashmap_tests.cpp 376462d1b472586f1547512e6e0a1646c4f76a44 
> 
> Diff: https://reviews.apache.org/r/54017/diff/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Neil Conway
> 
>


Re: Review Request 54017: Changed implementation of LinkedHashMap.

Posted by Michael Park <mp...@apache.org>.

> On Dec. 14, 2016, 1:30 p.m., Michael Park wrote:
> > 3rdparty/stout/include/stout/linkedhashmap.hpp, lines 32-34
> > <https://reviews.apache.org/r/54017/diff/2/?file=1569581#file1569581line32>
> >
> >     Let's get rid of the `typedef`s here
> 
> Neil Conway wrote:
>     `LinkedHashMap` previously used these `typedef`s, and the current `Cache` implementation also uses similar `typedef`s. I don't particularly care whether we use them or not, but I'd opt for deferring this to a separate change (and if we do change it, to also change `Cache`).

Sounds good.


- Michael


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54017/#review159225
-----------------------------------------------------------


On Nov. 23, 2016, 1:33 p.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54017/
> -----------------------------------------------------------
> 
> (Updated Nov. 23, 2016, 1:33 p.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-6626
>     https://issues.apache.org/jira/browse/MESOS-6626
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> LinkedHashMap<Key, Value> used two containers: a std::list<Key> and a
> hashmap<Key, std::pair<Value, std::list<Key>::iterator>>. That approach
> worked fine, but it made it difficult to support iterating over the
> key-value pairs in the map without jumping through hoops or copying.
> 
> Instead, this commit uses a std::list<std::pair<Key, Value>> and a
> hashmap<Key, std::list<std::pair<Key, Value>>::iterator>. This makes it
> easy to support iterating over the entries in the map in insertion
> order: we can just iterate over the list.
> 
> This commit just changes the implementation of LinkedHashMap; support
> for iteration will be added in a subsequent commit.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/linkedhashmap.hpp f48cc5933f9a786be325f71c83151376d1ffe844 
>   3rdparty/stout/tests/linkedhashmap_tests.cpp 376462d1b472586f1547512e6e0a1646c4f76a44 
> 
> Diff: https://reviews.apache.org/r/54017/diff/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Neil Conway
> 
>