Re: Review Request 46425: Add helper function to simplify tokenize handling.

2017-03-01 Thread Joris Van Remoortere

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



Closing this review due to inactivity. Please see our 
[guidelines](https://github.com/apache/mesos/blob/master/docs/reopening-reviews.md)
 for reopening reviews.

- Joris Van Remoortere


On June 29, 2016, 4:56 p.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46425/
> ---
> 
> (Updated June 29, 2016, 4:56 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Joris Van Remoortere.
> 
> 
> Bugs: MESOS-5234
> https://issues.apache.org/jira/browse/MESOS-5234
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add helper function to simplify tokenize handling.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
>   3rdparty/stout/tests/strings_tests.cpp 
> b54a9dbf162403310b8bba687442e184a473f5a6 
> 
> 
> Diff: https://reviews.apache.org/r/46425/diff/3/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 46425: Add helper function to simplify tokenize handling.

2016-12-14 Thread Joris Van Remoortere

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




3rdparty/stout/include/stout/strings.hpp (lines 170 - 175)


What do you think about introducing a building block version of this 
function like:
```
void foreachtoken(
const std::string& s,
const std::string& delims,
const lambda::function& max_tokens = None()) {
size_t count = 0;
foreachtoken(s, delims, [&](const string& token) -> bool {
  if (max_tokens.isSome() && count >= max_tokens.get()) { return false; 
}
  callback(token);
  ++count;
  return true;
});
}
```

I would also consider making `max_tokens` be a template parameter as from 
our code base it seems we are never interested in a dynamic value. This may be 
going too far though and is just food for thought for a future discussion.

What do you think?



3rdparty/stout/include/stout/strings.hpp (line 178)


Please do capture the callback by `const &` when implementing this pattern.

The rule to follow is:
-If the lambda will be fully consumed during the lifetime of the function, 
then it is safe to capture by `const &`.
-If the lambda will be invoked later, the code responsible for capturing 
the lambda to execute asynchronously should make the copy.


- Joris Van Remoortere


On June 29, 2016, 4:56 p.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46425/
> ---
> 
> (Updated June 29, 2016, 4:56 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Joris Van Remoortere.
> 
> 
> Bugs: MESOS-5234
> https://issues.apache.org/jira/browse/MESOS-5234
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add helper function to simplify tokenize handling.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
>   3rdparty/stout/tests/strings_tests.cpp 
> b54a9dbf162403310b8bba687442e184a473f5a6 
> 
> Diff: https://reviews.apache.org/r/46425/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 46425: Add helper function to simplify tokenize handling.

2016-06-11 Thread Klaus Ma

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

(Updated June 11, 2016, 5:21 p.m.)


Review request for mesos and Benjamin Mahler.


Changes
---

rebase


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


Repository: mesos


Description
---

Add helper function to simplify tokenize handling.


Diffs (updated)
-

  3rdparty/stout/include/stout/strings.hpp 
162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
  3rdparty/stout/tests/strings_tests.cpp 
b54a9dbf162403310b8bba687442e184a473f5a6 

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


Testing
---

make && make check


Thanks,

Klaus Ma



Re: Review Request 46425: Add helper function to simplify tokenize handling.

2016-04-27 Thread Klaus Ma

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



ping @joris :).

- Klaus Ma


On April 20, 2016, 1:48 p.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46425/
> ---
> 
> (Updated April 20, 2016, 1:48 p.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, and Michael Park.
> 
> 
> Bugs: MESOS-5234
> https://issues.apache.org/jira/browse/MESOS-5234
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add helper function to simplify tokenize handling.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
>   3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp 
> 7eed0f3d08cd52a07c46b6ad194496186ac205b7 
> 
> Diff: https://reviews.apache.org/r/46425/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 46425: Add helper function to simplify tokenize handling.

2016-04-20 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [46425]

Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' 
COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On April 20, 2016, 5:48 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46425/
> ---
> 
> (Updated April 20, 2016, 5:48 a.m.)
> 
> 
> Review request for mesos, Ben Mahler, Joris Van Remoortere, and Michael Park.
> 
> 
> Bugs: MESOS-5234
> https://issues.apache.org/jira/browse/MESOS-5234
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Add helper function to simplify tokenize handling.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp 
> 162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
>   3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp 
> 7eed0f3d08cd52a07c46b6ad194496186ac205b7 
> 
> Diff: https://reviews.apache.org/r/46425/diff/
> 
> 
> Testing
> ---
> 
> make && make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 46425: Add helper function to simplify tokenize handling.

2016-04-19 Thread Klaus Ma

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

(Updated April 20, 2016, 1:48 p.m.)


Review request for mesos, Ben Mahler, Joris Van Remoortere, and Michael Park.


Changes
---

Correct typo.


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


Repository: mesos


Description
---

Add helper function to simplify tokenize handling.


Diffs (updated)
-

  3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp 
162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
  3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp 
7eed0f3d08cd52a07c46b6ad194496186ac205b7 

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


Testing
---

make && make check


Thanks,

Klaus Ma



Review Request 46425: Add helper function to simplify tokenize handling.

2016-04-19 Thread Klaus Ma

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

Review request for mesos, Ben Mahler, Joris Van Remoortere, and Michael Park.


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


Repository: mesos


Description
---

Add helper function to simplify tokenize handling.


Diffs
-

  3rdparty/libprocess/3rdparty/stout/include/stout/strings.hpp 
162bdfb6c4f5a6b108761ebccd9b77e672f6dd87 
  3rdparty/libprocess/3rdparty/stout/tests/strings_tests.cpp 
7eed0f3d08cd52a07c46b6ad194496186ac205b7 

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


Testing
---

make && make check


Thanks,

Klaus Ma