You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@ambari.apache.org by Laszlo Puskas <lp...@hortonworks.com> on 2017/03/17 17:03:20 UTC

Review Request 57733: Configuration types are validated before the cluster resources are persisted.

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

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.


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/1/


Testing
-------

Manually tested on local environment.
Unit tests running.


Thanks,

Laszlo Puskas


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Laszlo Puskas <lp...@hortonworks.com>.

> On March 20, 2017, 8:54 a.m., Sebastian Toader wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/topology/validators/ClusterConfigTypeValidator.java
> > Lines 30 (patched)
> > <https://reviews.apache.org/r/57733/diff/4/?file=1667947#file1667947line30>
> >
> >     Implement equals and hashCode such as instances of this validator can be stored in hashmaps, sets etc.

As the class doesn't have any members the default (super) implementation is enough here.


> On March 20, 2017, 8:54 a.m., Sebastian Toader wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/topology/validators/ClusterConfigTypeValidator.java
> > Lines 37 (patched)
> > <https://reviews.apache.org/r/57733/diff/4/?file=1667947#file1667947line37>
> >
> >     Could ```topology.getConfiguration()``` ever be null?

This is always set to a value, i can add a null check however.


> On March 20, 2017, 8:54 a.m., Sebastian Toader wrote:
> > ambari-server/src/test/java/org/apache/ambari/server/topology/validators/ClusterConfigTypeValidatorTest.java
> > Lines 37 (patched)
> > <https://reviews.apache.org/r/57733/diff/4/?file=1667951#file1667951line37>
> >
> >     You could use ```EqualsVerifier``` to ensure that the ```equals``` and ```hashCode``` methods are properly implemented and are not broken inadvertently in the future.

Added a simple check.


- Laszlo


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


On March 18, 2017, 9: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, 9: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
> 
>


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Sebastian Toader <st...@hortonworks.com>.
-----------------------------------------------------------
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
> 
>


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Robert Levas <rl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/#review169434
-----------------------------------------------------------


Ship it!




Ship It!

- Robert Levas


On March 20, 2017, 7:48 a.m., Laszlo Puskas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57733/
> -----------------------------------------------------------
> 
> (Updated March 20, 2017, 7:48 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/6/
> 
> 
> Testing
> -------
> 
> Manually tested on local environment.
> Unit tests succeeded.
> 
> 
> Thanks,
> 
> Laszlo Puskas
> 
>


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Laszlo Puskas <lp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/
-----------------------------------------------------------

(Updated March 20, 2017, 11:48 a.m.)


Review request for Ambari, Robert Levas, Sandor Magyari, and Sebastian Toader.


Changes
-------

Fixed import order.


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 (updated)
-----

  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/6/

Changes: https://reviews.apache.org/r/57733/diff/5-6/


Testing
-------

Manually tested on local environment.
Unit tests succeeded.


Thanks,

Laszlo Puskas


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Sandor Magyari <sm...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/#review169416
-----------------------------------------------------------


Ship it!




Ship It!

- Sandor Magyari


On March 20, 2017, 10:38 a.m., Laszlo Puskas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57733/
> -----------------------------------------------------------
> 
> (Updated March 20, 2017, 10:38 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/5/
> 
> 
> Testing
> -------
> 
> Manually tested on local environment.
> Unit tests succeeded.
> 
> 
> Thanks,
> 
> Laszlo Puskas
> 
>


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Laszlo Puskas <lp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/
-----------------------------------------------------------

(Updated March 20, 2017, 10:38 a.m.)


Review request for Ambari, Robert Levas, Sandor Magyari, and Sebastian Toader.


Changes
-------

- Added null checks
- added test for equals
- validator list extracted into a member


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 (updated)
-----

  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/5/

Changes: https://reviews.apache.org/r/57733/diff/4-5/


Testing
-------

Manually tested on local environment.
Unit tests succeeded.


Thanks,

Laszlo Puskas


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Laszlo Puskas <lp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/
-----------------------------------------------------------

(Updated March 18, 2017, 9: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 (updated)
-----

  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/

Changes: https://reviews.apache.org/r/57733/diff/3-4/


Testing
-------

Manually tested on local environment.
Unit tests succeeded.


Thanks,

Laszlo Puskas


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Robert Levas <rl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/#review169311
-----------------------------------------------------------


Fix it, then Ship it!




Ship It!


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

    This should be below the copywrite block.


- Robert Levas


On March 17, 2017, 1:45 p.m., Laszlo Puskas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57733/
> -----------------------------------------------------------
> 
> (Updated March 17, 2017, 1:45 p.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/3/
> 
> 
> Testing
> -------
> 
> Manually tested on local environment.
> Unit tests succeeded.
> 
> 
> Thanks,
> 
> Laszlo Puskas
> 
>


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Laszlo Puskas <lp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/
-----------------------------------------------------------

(Updated March 17, 2017, 5:45 p.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/3/


Testing (updated)
-------

Manually tested on local environment.
Unit tests succeeded.


Thanks,

Laszlo Puskas


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Laszlo Puskas <lp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/
-----------------------------------------------------------

(Updated March 17, 2017, 5:45 p.m.)


Review request for Ambari, Robert Levas, Sandor Magyari, and Sebastian Toader.


Changes
-------

Fixed unit tests.


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 (updated)
-----

  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/3/

Changes: https://reviews.apache.org/r/57733/diff/2-3/


Testing
-------

Manually tested on local environment.
Unit tests running.


Thanks,

Laszlo Puskas


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Laszlo Puskas <lp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/
-----------------------------------------------------------

(Updated March 17, 2017, 5:10 p.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 (updated)
-------

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/2/


Testing
-------

Manually tested on local environment.
Unit tests running.


Thanks,

Laszlo Puskas


Re: Review Request 57733: Configuration types are validated before the cluster resources are persisted.

Posted by Laszlo Puskas <lp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/57733/
-----------------------------------------------------------

(Updated March 17, 2017, 5:07 p.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.


Diffs (updated)
-----

  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/2/

Changes: https://reviews.apache.org/r/57733/diff/1-2/


Testing
-------

Manually tested on local environment.
Unit tests running.


Thanks,

Laszlo Puskas