Re: Review Request 50851: Decode Protobuf long int form strings.

2017-03-01 Thread Joris Van Remoortere

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



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 Aug. 11, 2016, 8:47 a.m., Tomasz Janiszewski wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50851/
> ---
> 
> (Updated Aug. 11, 2016, 8:47 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Joseph Wu.
> 
> 
> Bugs: MESOS-5995
> https://issues.apache.org/jira/browse/MESOS-5995
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to Protobuf JSON mapping long integers
> should be stored as strings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/protobuf.hpp 
> 91305e104c01d649bd435a27b15954036c27 
>   3rdparty/stout/tests/protobuf_tests.cpp 
> 8877e8934e0f7875bfedcfa88b491ce4b13ca44f 
> 
> 
> Diff: https://reviews.apache.org/r/50851/diff/2/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Tomasz Janiszewski
> 
>



Re: Review Request 50851: Decode Protobuf long int form strings.

2016-08-11 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [50851]

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

- Mesos ReviewBot


On Aug. 11, 2016, 8:47 a.m., Tomasz Janiszewski wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50851/
> ---
> 
> (Updated Aug. 11, 2016, 8:47 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Joseph Wu.
> 
> 
> Bugs: MESOS-5995
> https://issues.apache.org/jira/browse/MESOS-5995
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to Protobuf JSON mapping long integers
> should be stored as strings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/protobuf.hpp 
> 91305e104c01d649bd435a27b15954036c27 
>   3rdparty/stout/tests/protobuf_tests.cpp 
> 8877e8934e0f7875bfedcfa88b491ce4b13ca44f 
> 
> Diff: https://reviews.apache.org/r/50851/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Tomasz Janiszewski
> 
>



Re: Review Request 50851: Decode Protobuf long int form strings.

2016-08-11 Thread Tomasz Janiszewski


> On Aug. 10, 2016, 11:53 p.m., Joseph Wu wrote:
> > Can you add the reason/motivation for this change in your patch description?

@Josheph I added description and fixed/commented issues. Would you like to 
review it one mor time.


- Tomasz


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


On Aug. 11, 2016, 8:47 a.m., Tomasz Janiszewski wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50851/
> ---
> 
> (Updated Aug. 11, 2016, 8:47 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Joseph Wu.
> 
> 
> Bugs: MESOS-5995
> https://issues.apache.org/jira/browse/MESOS-5995
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to Protobuf JSON mapping long integers
> should be stored as strings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/protobuf.hpp 
> 91305e104c01d649bd435a27b15954036c27 
>   3rdparty/stout/tests/protobuf_tests.cpp 
> 8877e8934e0f7875bfedcfa88b491ce4b13ca44f 
> 
> Diff: https://reviews.apache.org/r/50851/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Tomasz Janiszewski
> 
>



Re: Review Request 50851: Decode Protobuf long int form strings.

2016-08-11 Thread Tomasz Janiszewski


> On Aug. 10, 2016, 11:53 p.m., Joseph Wu wrote:
> > 3rdparty/stout/include/stout/protobuf.hpp, lines 443-459
> > 
> >
> > I wonder how far we want to follow the protobuf mapping 
> > recommendations.  Technically, protobuf3 takes strings for all types of 
> > numbers :)
> > 
> > I'm fine with just large numbers however.

int32, fixed32, uint32 should be stored as a numbers. With float and double 
there is exception for "NaN" and "Infinity"


> On Aug. 10, 2016, 11:53 p.m., Joseph Wu wrote:
> > 3rdparty/stout/include/stout/protobuf.hpp, line 447
> > 
> >
> > Unfortunately, `std::stoll` and similar functions will throw exceptions 
> > if they fail.  And Mesos does not use exceptions.
> > 
> > You'll need to parse the string some other way (i.e. `strtoimax`) and 
> > return an `Error` if the parsing fails.

Good catch. I used `numify`.


> On Aug. 10, 2016, 11:53 p.m., Joseph Wu wrote:
> > 3rdparty/stout/tests/protobuf_tests.cpp, lines 334-336
> > 
> >
> > This should be checking for equality, rather than parse success:
> > 
> > EXPECT_SOME_EQ(, json);

In this test I'm not interested in checking if String to JSON works. It's only 
used to generate JSON that will be parsed into message.


> On Aug. 10, 2016, 11:53 p.m., Joseph Wu wrote:
> > 3rdparty/stout/tests/protobuf_tests.cpp, lines 342-343
> > 
> >
> > This is actually a Protobuf -> JSON -> String conversion.
> > 
> > You'll want to split these two apart and have one comparision for each 
> > step.

I changed it to compare against `Message` object. But since there is no equal 
method for protobuf object I serialise them to JSON.


- Tomasz


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


On Aug. 11, 2016, 8:47 a.m., Tomasz Janiszewski wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50851/
> ---
> 
> (Updated Aug. 11, 2016, 8:47 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Joseph Wu.
> 
> 
> Bugs: MESOS-5995
> https://issues.apache.org/jira/browse/MESOS-5995
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> According to Protobuf JSON mapping long integers
> should be stored as strings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/protobuf.hpp 
> 91305e104c01d649bd435a27b15954036c27 
>   3rdparty/stout/tests/protobuf_tests.cpp 
> 8877e8934e0f7875bfedcfa88b491ce4b13ca44f 
> 
> Diff: https://reviews.apache.org/r/50851/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Tomasz Janiszewski
> 
>



Re: Review Request 50851: Decode Protobuf long int form strings.

2016-08-11 Thread Tomasz Janiszewski

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

(Updated Aug. 11, 2016, 8:47 a.m.)


Review request for mesos, Anand Mazumdar and Joseph Wu.


Changes
---

Use numify to parse strings and handle errors.


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


Repository: mesos


Description (updated)
---

According to Protobuf JSON mapping long integers
should be stored as strings.


Diffs (updated)
-

  3rdparty/stout/include/stout/protobuf.hpp 
91305e104c01d649bd435a27b15954036c27 
  3rdparty/stout/tests/protobuf_tests.cpp 
8877e8934e0f7875bfedcfa88b491ce4b13ca44f 

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


Testing
---


Thanks,

Tomasz Janiszewski



Re: Review Request 50851: Decode Protobuf long int form strings.

2016-08-10 Thread Joseph Wu

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



Can you add the reason/motivation for this change in your patch description?


3rdparty/stout/include/stout/protobuf.hpp (lines 443 - 459)


I wonder how far we want to follow the protobuf mapping recommendations.  
Technically, protobuf3 takes strings for all types of numbers :)

I'm fine with just large numbers however.



3rdparty/stout/include/stout/protobuf.hpp (line 447)


Unfortunately, `std::stoll` and similar functions will throw exceptions if 
they fail.  And Mesos does not use exceptions.

You'll need to parse the string some other way (i.e. `strtoimax`) and 
return an `Error` if the parsing fails.



3rdparty/stout/tests/protobuf_tests.cpp (lines 334 - 336)


This should be checking for equality, rather than parse success:

EXPECT_SOME_EQ(, json);



3rdparty/stout/tests/protobuf_tests.cpp (lines 342 - 343)


This is actually a Protobuf -> JSON -> String conversion.

You'll want to split these two apart and have one comparision for each step.


- Joseph Wu


On Aug. 5, 2016, 7:33 a.m., Tomasz Janiszewski wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50851/
> ---
> 
> (Updated Aug. 5, 2016, 7:33 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Joseph Wu.
> 
> 
> Bugs: MESOS-5995
> https://issues.apache.org/jira/browse/MESOS-5995
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Decode Protobuf long int form strings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/protobuf.hpp 
> 91305e104c01d649bd435a27b15954036c27 
>   3rdparty/stout/tests/protobuf_tests.cpp 
> 8877e8934e0f7875bfedcfa88b491ce4b13ca44f 
> 
> Diff: https://reviews.apache.org/r/50851/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Tomasz Janiszewski
> 
>



Re: Review Request 50851: Decode Protobuf long int form strings.

2016-08-05 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [50851]

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

- Mesos ReviewBot


On Aug. 5, 2016, 2:33 p.m., Tomasz Janiszewski wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50851/
> ---
> 
> (Updated Aug. 5, 2016, 2:33 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar and Joseph Wu.
> 
> 
> Bugs: MESOS-5995
> https://issues.apache.org/jira/browse/MESOS-5995
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Decode Protobuf long int form strings.
> 
> 
> Diffs
> -
> 
>   3rdparty/stout/include/stout/protobuf.hpp 
> 91305e104c01d649bd435a27b15954036c27 
>   3rdparty/stout/tests/protobuf_tests.cpp 
> 8877e8934e0f7875bfedcfa88b491ce4b13ca44f 
> 
> Diff: https://reviews.apache.org/r/50851/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Tomasz Janiszewski
> 
>



Review Request 50851: Decode Protobuf long int form strings.

2016-08-05 Thread Tomasz Janiszewski

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

Review request for mesos, Anand Mazumdar and Joseph Wu.


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


Repository: mesos


Description
---

Decode Protobuf long int form strings.


Diffs
-

  3rdparty/stout/include/stout/protobuf.hpp 
91305e104c01d649bd435a27b15954036c27 
  3rdparty/stout/tests/protobuf_tests.cpp 
8877e8934e0f7875bfedcfa88b491ce4b13ca44f 

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


Testing
---


Thanks,

Tomasz Janiszewski