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


Fix it, then Ship it!





ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequest.java
Line 272 (original), 271-274 (patched)
<https://reviews.apache.org/r/57733/#comment241748>

    Is the collection of topology validators being changed in other methods? If 
not than make this a singleton readonly field. (e.g. you could use guava's 
```ImmutableSet```)



ambari-server/src/main/java/org/apache/ambari/server/topology/validators/ClusterConfigTypeValidator.java
Lines 30 (patched)
<https://reviews.apache.org/r/57733/#comment241752>

    Implement equals and hashCode such as instances of this validator can be 
stored in hashmaps, sets etc.



ambari-server/src/main/java/org/apache/ambari/server/topology/validators/ClusterConfigTypeValidator.java
Lines 37 (patched)
<https://reviews.apache.org/r/57733/#comment241749>

    Could ```topology.getConfiguration()``` ever be null?



ambari-server/src/test/java/org/apache/ambari/server/topology/validators/ClusterConfigTypeValidatorTest.java
Lines 37 (patched)
<https://reviews.apache.org/r/57733/#comment241751>

    You could use ```EqualsVerifier``` to ensure that the ```equals``` and 
```hashCode``` methods are properly implemented and are not broken 
inadvertently in the future.


- Sebastian Toader


On March 18, 2017, 10:59 a.m., Laszlo Puskas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57733/
> -----------------------------------------------------------
> 
> (Updated March 18, 2017, 10:59 a.m.)
> 
> 
> Review request for Ambari, Robert Levas, Sandor Magyari, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-20488
>     https://issues.apache.org/jira/browse/AMBARI-20488
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> When a cluster is created using blueprints it is possible to pass 
> configuration in the cluster creation template (that is posted after the 
> blueprint isent in)
> On cluster provisioning configurations are validated and if errors are found 
> the cluster provisioning is interrupted. As the configuration validation is 
> done after the cluster resources are persisted it's not possible to resend 
> the (possibly corrected) cluster template and restart the cluster 
> provisioning.
> Solution:
> Perform the configuration type validation before the cluster resources are 
> persisted.
> 
> Note:
> Created new package for topology validators and moved existing validators 
> into it.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequest.java
>  2c8d09a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/topology/RequiredPasswordValidator.java
>  41812c3 
>   
> ambari-server/src/main/java/org/apache/ambari/server/topology/validators/ClusterConfigTypeValidator.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/topology/validators/RequiredPasswordValidator.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequestTest.java
>  c64da62 
>   
> ambari-server/src/test/java/org/apache/ambari/server/topology/RequiredPasswordValidatorTest.java
>  8ab3a43 
>   
> ambari-server/src/test/java/org/apache/ambari/server/topology/validators/ClusterConfigTypeValidatorTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/57733/diff/4/
> 
> 
> Testing
> -------
> 
> Manually tested on local environment.
> Unit tests succeeded.
> 
> 
> Thanks,
> 
> Laszlo Puskas
> 
>

Reply via email to