You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Tom Beerbower <tb...@hortonworks.com> on 2015/01/02 16:30:26 UTC
Re: Review Request 29207: Example view to exercise the view validator
capability
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29207/#review66522
-----------------------------------------------------------
Ship it!
ambari-views/examples/property-validator-view/src/main/java/org/apache/ambari/view/property/MyValidator.java
<https://reviews.apache.org/r/29207/#comment110099>
This is okay. Just a minor comment on the use of the Validator interface...
Its just a little strange that validateParameterValues() will make the same check twice... once for PARAMETER_NAME_FIRST_VALUE and once for PARAMETER_NAME_SECOND_VALUE.
The intent of the validateProperty() method is to allow for each property to be checked individually.
If the method gets called for PARAMETER_NAME_FIRST_VALUE and PARAMETER_NAME_SECOND_VALUE is not an integer then the check for PARAMETER_NAME_FIRST_VALUE fails even though it may be perfectly fine.
I think that in this case the framework might report that PARAMETER_NAME_FIRST_VALUE is invalid because PARAMETER_NAME_SECOND_VALUE is not an integer.
You could refactor validateProperty() so that it only checks the request property one at a time or change it so that validateProperty() just checks to see if the requested property is the correct format and validations across multiple properties are done in validateInstance().
- Tom Beerbower
On Dec. 22, 2014, 7:07 p.m., Jeff Sposetti wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29207/
> -----------------------------------------------------------
>
> (Updated Dec. 22, 2014, 7:07 p.m.)
>
>
> Review request for Ambari, Srimanth Gunturi, Tom Beerbower, and Yusaku Sako.
>
>
> Bugs: AMBARI-8798
> https://issues.apache.org/jira/browse/AMBARI-8798
>
>
> Repository: ambari
>
>
> Description
> -------
>
>
> Provide an example view that exercises the view validator capability. Includes example of URL, integer and two value checks.
>
>
> Diffs
> -----
>
> ambari-views/examples/README.md 4b65216
> ambari-views/examples/property-validator-view/docs/index.md PRE-CREATION
> ambari-views/examples/property-validator-view/pom.xml PRE-CREATION
> ambari-views/examples/property-validator-view/src/main/java/org/apache/ambari/view/property/MyValidator.java PRE-CREATION
> ambari-views/examples/property-validator-view/src/main/java/org/apache/ambari/view/property/PropertyValidatorService.java PRE-CREATION
> ambari-views/examples/property-validator-view/src/main/resources/ui/index.html PRE-CREATION
> ambari-views/examples/property-validator-view/src/main/resources/view.xml PRE-CREATION
>
> Diff: https://reviews.apache.org/r/29207/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Jeff Sposetti
>
>