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