> On Aug. 10, 2016, 8:28 a.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java,
> >  lines 42-51
> > <https://reviews.apache.org/r/50911/diff/2/?file=1469651#file1469651line42>
> >
> >     Shouldn't need a new enum when TRUE/FALSE/NULL would suffice.
> 
> Alejandro Fernandez wrote:
>     Are you suggesting Boolean instead? I think an Enum is just as simple but 
> gives us more options.
> 
> Nate Cole wrote:
>     What are the other options?  null-checking is common.  Are you saying in 
> the above comment that true/false/inherit/null is valid?  What happens/what 
> is the default if you use the enum and it's null?

Inherit is implied if there is no element, right? That's basically null. I'm 
fine with leaving it as a boolean and null-checking to see if it's defined. The 
enum just converts the lack of an element into a switch-able type.


- Jonathan


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


On Aug. 9, 2016, 9:22 p.m., Alejandro Fernandez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50911/
> -----------------------------------------------------------
> 
> (Updated Aug. 9, 2016, 9:22 p.m.)
> 
> 
> Review request for Ambari, Dmytro Grinenko, Di Li, Dmitro Lisnichenko, 
> Jonathan Hurley, Jayush Luniya, Nate Cole, and Tim Thorpe.
> 
> 
> Bugs: AMBARI-18070
>     https://issues.apache.org/jira/browse/AMBARI-18070
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Fresh install of HDP 2.5 does not have a version for ATLAS_SERVER or 
> ATLAS_CLIENT in the database (hostcomponentstate table) because ATLAS has 
> advertise_version as "false".
> 
> Atlas in common-services for has the following,
> 0.1.0.2.3 has versionAdvertised=false
> 0.7.0.2.5 has versionAdvertised=true
> 
> However, the current logic in ComponentModule always take the value of the 
> parent, which is incorrect.
> 
> To fix this, if the current component has false, then take the value of the 
> parent.
> 
> The ideal way to do this is to use another variable (a string) to read from 
> the xml file so we can store "true", "false", null. If that variable is null, 
> then inherit from the parent.
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/stack/ComponentModule.java
>  d9d3105 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/ComponentInfo.java 
> a5004b2 
>   
> ambari-server/src/main/resources/common-services/ATLAS/0.7.0.2.5/metainfo.xml 
> 630d403 
>   
> ambari-server/src/test/java/org/apache/ambari/server/stack/ComponentModuleTest.java
>  f21b250 
> 
> Diff: https://reviews.apache.org/r/50911/diff/
> 
> 
> Testing
> -------
> 
> Added unit test. Waiting for full unit test results.
> 
> Verified via the api,
> /api/v1/stacks/HDP/2.5/services/ATLAS/components has advertise_version=false
> /api/v1/stacks/HDP/2.5/services/ATLAS/components has advertise_version=true
> 
> Also tested with Storm, which has 4 versions inside common-services, by 
> setting the metainfo.xml file for all versions  with versionAdvertised=false, 
> which yielded advertise_version=false for all versions via the API, and then
> changing only the first metainfo.xml file to versionAdvertised=true in 
> metainfo.xml, which yielded all versions via the API reporting 
> advertise_version=true
> 
> 
> Thanks,
> 
> Alejandro Fernandez
> 
>

Reply via email to