ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Speidel" <jspei...@hortonworks.com>
Subject Re: Review Request 34157: Provide host predicate property validation for blueprint requests
Date Wed, 13 May 2015 15:38:40 GMT


> On May 13, 2015, 2:52 p.m., Robert Levas wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseClusterRequest.java,
lines 84-86
> > <https://reviews.apache.org/r/34157/diff/1/?file=957944#file957944line84>
> >
> >     It seems like injection could be used rather than this `init` method. But this
does match a pattern we see throughout the code.

Yeah, I often struggle with which 'injection' approach that I should use.  Dependency Injection
in Ambari is currently a real mess and is actually one of my "top 5" issues that I responded
with regarding the recent "making things better poll". I left this like this for the moment
because it is very likely that this "injection" wont be required in the near future as I am
considering changing the TopologyRequest interface to return a blueprint name and not a blueprint.


- John


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


On May 13, 2015, 3:41 a.m., John Speidel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34157/
> -----------------------------------------------------------
> 
> (Updated May 13, 2015, 3:41 a.m.)
> 
> 
> Review request for Ambari, Robert Levas and Robert Nettleton.
> 
> 
> Bugs: AMBARI-11093
>     https://issues.apache.org/jira/browse/AMBARI-11093
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> When specifying a host predicate via the "host_predicate" property in the cluster creation
template, the predicate is compiled using the API predicate compiler which will report syntactic
errors in the predicate but the property names aren't validated. So, if an invalid property
name is specified in the predicate, the host group will never get matched to any host meaning
that the host group will never be deployed.
> This is critical that this is fixed for 2.1 as it will cause great frustration to anyone
who attempts to provision or scale a cluster and specifies a host predicate with an invalid
proper name.
> When an invalid property name is specified a host predicate, this should result in a
400 response to the the user with a message which indicates the invalid properties.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java 77f6d2c

>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseClusterRequest.java
PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
47a4ce0 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequest.java
a1a0ac6 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ScaleClusterRequest.java
1530a3e 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequestTest.java
acfd426 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java
PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/34157/diff/
> 
> 
> Testing
> -------
> 
> Functional Testing:
> Provisioned and scaled clusters with combination of explicit host names, host counts
and host predicates and host registrations prior to and after cluster/scaling operations.
> 
> Unit Tests:
> New Tests and all existing tests pass.
> 
> Results :
> 
> Tests run: 2978, Failures: 0, Errors: 0, Skipped: 20
> ...
> Total run:739
> Total errors:0
> Total failures:0
> 
> 
> Thanks,
> 
> John Speidel
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message