You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Attila Doroszlai <ad...@hortonworks.com> on 2017/11/22 12:45:50 UTC

Review Request 64027: Ambari server becomes unusable when config properties are misconfigured

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

Review request for Ambari, Attila Magyar, Balázs Bence Sári, and Miklos Gergely.


Repository: ambari


Description
-------

Not all numeric values are valid doubles, eg. 86400L is a valid long, but not a double.

Changed to `NumberUtils.createNumber` instead of `Double.parseDouble` to create the appropriate numeric object.
Checking `doubleValue()` is necessary for equal values of different types (eg. `0.0` vs `0`).

Also fixed possible NPE in non-numeric case.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java eade91458847125df8e50505cb2af5bd67ee0b3d 
  ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java 8a0a78228e72fc14ff361445363fa61d1cc4e977 


Diff: https://reviews.apache.org/r/64027/diff/1/


Testing
-------

Added unit test:

```
[INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 19.31 s - in org.apache.ambari.server.state.ConfigHelperTest
```


Thanks,

Attila Doroszlai


Re: Review Request 64027: Ambari server becomes unusable when config properties are misconfigured

Posted by Miklos Gergely <mg...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64027/#review191729
-----------------------------------------------------------


Ship it!




Ship It!

- Miklos Gergely


On Nov. 22, 2017, 12:52 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64027/
> -----------------------------------------------------------
> 
> (Updated Nov. 22, 2017, 12:52 p.m.)
> 
> 
> Review request for Ambari, Attila Magyar, Balázs Bence Sári, and Miklos Gergely.
> 
> 
> Bugs: AMBARI-22499
>     https://issues.apache.org/jira/browse/AMBARI-22499
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Not all numeric values are valid doubles, eg. 86400L is a valid long, but not a double.
> 
> Changed to `NumberUtils.createNumber` instead of `Double.parseDouble` to create the appropriate numeric object.
> Checking `doubleValue()` is necessary for equal values of different types (eg. `0.0` vs `0`).
> 
> Also fixed possible NPE in non-numeric case.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java eade91458847125df8e50505cb2af5bd67ee0b3d 
>   ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java 8a0a78228e72fc14ff361445363fa61d1cc4e977 
> 
> 
> Diff: https://reviews.apache.org/r/64027/diff/1/
> 
> 
> Testing
> -------
> 
> Added unit test:
> 
> ```
> [INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 19.31 s - in org.apache.ambari.server.state.ConfigHelperTest
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 64027: Ambari server becomes unusable when config properties are misconfigured

Posted by Balázs Bence Sári <bs...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64027/#review191887
-----------------------------------------------------------


Ship it!




Ship It!

- Balázs Bence Sári


On Nov. 22, 2017, 12:52 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64027/
> -----------------------------------------------------------
> 
> (Updated Nov. 22, 2017, 12:52 p.m.)
> 
> 
> Review request for Ambari, Attila Magyar, Balázs Bence Sári, and Miklos Gergely.
> 
> 
> Bugs: AMBARI-22499
>     https://issues.apache.org/jira/browse/AMBARI-22499
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Not all numeric values are valid doubles, eg. 86400L is a valid long, but not a double.
> 
> Changed to `NumberUtils.createNumber` instead of `Double.parseDouble` to create the appropriate numeric object.
> Checking `doubleValue()` is necessary for equal values of different types (eg. `0.0` vs `0`).
> 
> Also fixed possible NPE in non-numeric case.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java eade91458847125df8e50505cb2af5bd67ee0b3d 
>   ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java 8a0a78228e72fc14ff361445363fa61d1cc4e977 
> 
> 
> Diff: https://reviews.apache.org/r/64027/diff/1/
> 
> 
> Testing
> -------
> 
> Added unit test:
> 
> ```
> [INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 19.31 s - in org.apache.ambari.server.state.ConfigHelperTest
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 64027: Ambari server becomes unusable when config properties are misconfigured

Posted by Attila Magyar <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64027/#review191733
-----------------------------------------------------------


Ship it!




Ship It!

- Attila Magyar


On Nov. 22, 2017, 12:52 p.m., Attila Doroszlai wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/64027/
> -----------------------------------------------------------
> 
> (Updated Nov. 22, 2017, 12:52 p.m.)
> 
> 
> Review request for Ambari, Attila Magyar, Balázs Bence Sári, and Miklos Gergely.
> 
> 
> Bugs: AMBARI-22499
>     https://issues.apache.org/jira/browse/AMBARI-22499
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Not all numeric values are valid doubles, eg. 86400L is a valid long, but not a double.
> 
> Changed to `NumberUtils.createNumber` instead of `Double.parseDouble` to create the appropriate numeric object.
> Checking `doubleValue()` is necessary for equal values of different types (eg. `0.0` vs `0`).
> 
> Also fixed possible NPE in non-numeric case.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java eade91458847125df8e50505cb2af5bd67ee0b3d 
>   ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java 8a0a78228e72fc14ff361445363fa61d1cc4e977 
> 
> 
> Diff: https://reviews.apache.org/r/64027/diff/1/
> 
> 
> Testing
> -------
> 
> Added unit test:
> 
> ```
> [INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 19.31 s - in org.apache.ambari.server.state.ConfigHelperTest
> ```
> 
> 
> Thanks,
> 
> Attila Doroszlai
> 
>


Re: Review Request 64027: Ambari server becomes unusable when config properties are misconfigured

Posted by Attila Doroszlai <ad...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/64027/
-----------------------------------------------------------

(Updated Nov. 22, 2017, 1:52 p.m.)


Review request for Ambari, Attila Magyar, Balázs Bence Sári, and Miklos Gergely.


Bugs: AMBARI-22499
    https://issues.apache.org/jira/browse/AMBARI-22499


Repository: ambari


Description
-------

Not all numeric values are valid doubles, eg. 86400L is a valid long, but not a double.

Changed to `NumberUtils.createNumber` instead of `Double.parseDouble` to create the appropriate numeric object.
Checking `doubleValue()` is necessary for equal values of different types (eg. `0.0` vs `0`).

Also fixed possible NPE in non-numeric case.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java eade91458847125df8e50505cb2af5bd67ee0b3d 
  ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java 8a0a78228e72fc14ff361445363fa61d1cc4e977 


Diff: https://reviews.apache.org/r/64027/diff/1/


Testing
-------

Added unit test:

```
[INFO] Tests run: 25, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 19.31 s - in org.apache.ambari.server.state.ConfigHelperTest
```


Thanks,

Attila Doroszlai