Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-31 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [33792]

All tests passed.

- Mesos ReviewBot


On June 1, 2015, 4:17 a.m., haosdent huang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33792/
> ---
> 
> (Updated June 1, 2015, 4:17 a.m.)
> 
> 
> Review request for mesos, Alexander Rojas and Ben Mahler.
> 
> 
> Bugs: MESOS-328
> https://issues.apache.org/jira/browse/MESOS-328
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Extend hashmap to support custom equality and hash
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
> 215007b7ba8c4093ce95b79a07fd84445048b58a 
> 
> Diff: https://reviews.apache.org/r/33792/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-31 Thread haosdent huang

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

(Updated June 1, 2015, 4:17 a.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Changes
---

Rebase from current master


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Extend hashmap to support custom equality and hash


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
215007b7ba8c4093ce95b79a07fd84445048b58a 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-19 Thread Alexander Rojas

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

Ship it!


Ship It!

- Alexander Rojas


On May 20, 2015, 4:06 a.m., haosdent huang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33792/
> ---
> 
> (Updated May 20, 2015, 4:06 a.m.)
> 
> 
> Review request for mesos, Alexander Rojas and Ben Mahler.
> 
> 
> Bugs: MESOS-328
> https://issues.apache.org/jira/browse/MESOS-328
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Extend hashmap to support custom equality and hash
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
> 24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
> 
> Diff: https://reviews.apache.org/r/33792/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-19 Thread haosdent huang

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

(Updated May 20, 2015, 2:06 a.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Extend hashmap to support custom equality and hash


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-19 Thread Ben Mahler

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

Ship it!


Thanks hsaodent! Just one minor change below.


3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp


Can we change this to 'Equal'? s/Pred/Equal/

This describes what it does, and I also noticed you called it 'Equal' in 
https://reviews.apache.org/r/33793 ;)


- Ben Mahler


On May 12, 2015, 12:55 a.m., haosdent huang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33792/
> ---
> 
> (Updated May 12, 2015, 12:55 a.m.)
> 
> 
> Review request for mesos, Alexander Rojas and Ben Mahler.
> 
> 
> Bugs: MESOS-328
> https://issues.apache.org/jira/browse/MESOS-328
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Extend hashmap to support custom equality and hash
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
> 24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
> 
> Diff: https://reviews.apache.org/r/33792/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-11 Thread haosdent huang


> On May 11, 2015, 10:47 p.m., Ben Mahler wrote:
> > Thanks! Could you split the patch between the implementation and the test? 
> > The implementation looks pretty good so would like to give a ship it on 
> > that before I review the test. Much appreciated :)

Hi, @bmahler. I update the patch and split them. The test part: 
https://reviews.apache.org/r/34068/ .
And feel very sorry that no follow the style guide before, could you help me 
review again? Thank you very much.


- haosdent


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


On May 12, 2015, 12:55 a.m., haosdent huang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33792/
> ---
> 
> (Updated May 12, 2015, 12:55 a.m.)
> 
> 
> Review request for mesos, Alexander Rojas and Ben Mahler.
> 
> 
> Bugs: MESOS-328
> https://issues.apache.org/jira/browse/MESOS-328
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Extend hashmap to support custom equality and hash
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
> 24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
> 
> Diff: https://reviews.apache.org/r/33792/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-11 Thread haosdent huang

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

(Updated May 12, 2015, 12:55 a.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Extend hashmap to support custom equality and hash


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-11 Thread haosdent huang

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

(Updated May 12, 2015, 12:54 a.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Extend hashmap to support custom equality and hash


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-11 Thread haosdent huang

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

(Updated May 12, 2015, 12:50 a.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Extend hashmap to support custom equality and hash


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
  3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp 
e8a932e5474bf2ba1a93a945ff9bc61fb5146c02 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-11 Thread Ben Mahler

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


Thanks! Could you split the patch between the implementation and the test? The 
implementation looks pretty good so would like to give a ship it on that before 
I review the test. Much appreciated :)


3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp


We wrap lines of code beyond 80 characters, but this fits on one line:

```
>>> len('class hashmap : public boost::unordered_map')
67
```

Can you undo the line wrapping here?



3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp


Have you looked at the style guide? We try to avoid this style of wrapping 
because it is "jagged", can you wrap as follows:

```
boost::unordered_map::emplace(
it->first, it->second);
```



3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp


Fits on one line:

```
>>> len('boost::unordered_map::erase(key);')
61
```



3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp


Can you wrap as follows:

```
boost::unordered_map::insert(
std::pair(key, value));
```



3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp


Add an extra line here to be consistent with the rest of this file


- Ben Mahler


On May 9, 2015, 3:36 p.m., haosdent huang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33792/
> ---
> 
> (Updated May 9, 2015, 3:36 p.m.)
> 
> 
> Review request for mesos, Alexander Rojas and Ben Mahler.
> 
> 
> Bugs: MESOS-328
> https://issues.apache.org/jira/browse/MESOS-328
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Extend hashmap to support custom equality and hash
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
> 24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
>   3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp 
> e8a932e5474bf2ba1a93a945ff9bc61fb5146c02 
> 
> Diff: https://reviews.apache.org/r/33792/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-09 Thread haosdent huang

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

(Updated May 9, 2015, 3:36 p.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Extend hashmap to support custom equality and hash


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
  3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp 
e8a932e5474bf2ba1a93a945ff9bc61fb5146c02 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-09 Thread haosdent huang

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

(Updated May 9, 2015, 3:24 p.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description (updated)
---

Extend hashmap to support custom equality and hash


Diffs
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
  3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp 
e8a932e5474bf2ba1a93a945ff9bc61fb5146c02 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-09 Thread haosdent huang

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

(Updated May 9, 2015, 3:23 p.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Add InsensitiveHashMap.


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
  3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp 
e8a932e5474bf2ba1a93a945ff9bc61fb5146c02 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-09 Thread haosdent huang

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

(Updated May 9, 2015, 3:13 p.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Add InsensitiveHashMap.


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
  3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp 
e8a932e5474bf2ba1a93a945ff9bc61fb5146c02 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-09 Thread haosdent huang


> On May 4, 2015, 6:46 p.m., Alexander Rojas wrote:
> > I am not really sure this is the way to go in order to create a case 
> > insensite hashmap. The class `hashmap` simply adds functionality to the 
> > `boost::unordered_map`. If one checks the API for the latter, the way 
> > needed to create an insensitive hashmap is to override the template 
> > parameters `Hash` and `Pred`. So I think it would be better simply to 
> > expose them in hashmap changin `stout/hashmpa.hpp` to:
> > 
> > ```cpp
> > template , 
> > typename Pred = std::equal_to>
> > class hashmap : public boost::unoredered_map
> > {
> >   …
> > };
> > ```
> > 
> > The you only need to define functors that provide insensitive operatiosn 
> > for `Hash` and `Pred` and finally a typedef.
> 
> Ben Mahler wrote:
> Another approach here is to define a type for the key which captures what 
> we want ('CaseInsensitiveString'), this lets us capture it in the type 
> signature cleanly: hashmap.
> 
> But, in line with what Alex wrote, and from my 
> [comment](https://issues.apache.org/jira/browse/MESOS-328?focusedCommentId=14526217&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14526217)
>  in MESOS-328, I'd suggest one of the following:
> 
> (1) Use unordered_map with custom equality and hash in http::Request / 
> http::Response (we have c++11 now so can assume the presence of 
> std::unordered_map).
> (2) Extend hashmap to support custom equality and hash, and use this in 
> http::Request / http::Response.

@arojas @bmahler I update the patch and I choose exterd hashmap to support 
custom equality and hash. But I am not sure where should I add the 
InsensitiveHash and InsensitiveEqual now. I put them in http.hpp now, you could 
check it out from another [review](https://reviews.apache.org/r/33793/diff/#). 
By the way, I not sure whether I should add a typedef or not. And If I want add 
a typedef, should I add it to http.hpp or hashmap.hpp?


- haosdent


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


On May 9, 2015, 3:04 p.m., haosdent huang wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33792/
> ---
> 
> (Updated May 9, 2015, 3:04 p.m.)
> 
> 
> Review request for mesos, Alexander Rojas and Ben Mahler.
> 
> 
> Bugs: MESOS-328
> https://issues.apache.org/jira/browse/MESOS-328
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add InsensitiveHashMap.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
> 24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
>   3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp 
> e8a932e5474bf2ba1a93a945ff9bc61fb5146c02 
> 
> Diff: https://reviews.apache.org/r/33792/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-09 Thread haosdent huang

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

(Updated May 9, 2015, 3:04 p.m.)


Review request for mesos, Alexander Rojas and Ben Mahler.


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Add InsensitiveHashMap.


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
  3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp 
e8a932e5474bf2ba1a93a945ff9bc61fb5146c02 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang



Re: Review Request 33792: Extend hashmap to support custom equality and hash

2015-05-09 Thread haosdent huang

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

(Updated May 9, 2015, 2:56 p.m.)


Review request for mesos and Ben Mahler.


Summary (updated)
-

Extend hashmap to support custom equality and hash


Bugs: MESOS-328
https://issues.apache.org/jira/browse/MESOS-328


Repository: mesos


Description
---

Add InsensitiveHashMap.


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/hashmap.hpp 
24dc369ec271ec2f35449e6ccf49c5b829ca6ce8 
  3rdparty/libprocess/3rdparty/stout/tests/hashmap_tests.cpp 
e8a932e5474bf2ba1a93a945ff9bc61fb5146c02 

Diff: https://reviews.apache.org/r/33792/diff/


Testing
---

make check


Thanks,

haosdent huang