You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Sumit Mohanty (JIRA)" <ji...@apache.org> on 2013/09/13 19:02:52 UTC

[jira] [Commented] (AMBARI-2819) Extending Stack definition to remove duplication in stack metadata info.

    [ https://issues.apache.org/jira/browse/AMBARI-2819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13766643#comment-13766643 ] 

Sumit Mohanty commented on AMBARI-2819:
---------------------------------------

Nice. The code looks pretty good. Few minor comments. 
We need to add more unit tests - see below for suggested ones.

Comments:
*File*: ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java 
* private String parentVersion;
** Why do we need to expose the parent version. Is this relevant to the API consumer?

*File*: ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackVersionResourceProvider.java
*  public Set<Resource> getResources(Request request, Predicate predicate)
** Add back the @Override tag

*Test related*
* We should add tests for 
** New configuration property being added to a service
** Similarly, removing a configuration and also throw in a check for configs that did not change
** Adding a component
** Also pick one test from AmbariManagementController unit tests and modify it to use 2.0.6 rather than 2.0.5. This will validate that unit tests can run with the inheritance model
* Add some unit tests for key helper methods such as
** getParentStacksInOrder
** getAllApplicableServices

                
> Extending Stack definition to remove duplication in stack metadata info.
> ------------------------------------------------------------------------
>
>                 Key: AMBARI-2819
>                 URL: https://issues.apache.org/jira/browse/AMBARI-2819
>             Project: Ambari
>          Issue Type: Improvement
>          Components: controller
>            Reporter: Siddharth Wagle
>            Assignee: Siddharth Wagle
>         Attachments: AMBARI-2819.patch
>
>
> The idea is to allow extending a stack definition and overriding some of its values.
> Current stack definition structure of files and directories:
> {noformat}
> |_ stacks
>    |_ <dist_name>
>       |_ <version_number>
>          metainfo.xml
>          |_ repos
>              repoinfo.xml
>          |_ services
>             |_ <service_name>
>                metainfo.xml
>                |_ configuration
>                   configuration files
> {noformat}
> We introduce extends element at the top level (stack version level) that links to the parent stack definition for this stack version.
> *Rules of extension*: 
> 1.    All of the parent stack services are automatically a part of the child stack unless explicitly excluded.
> 2.    Only one parent stack can be extended by the child stack.
> 3.    <stacks>.<dist_name>.<repos>.repoinfo.xml, will not be overridden
> 4.    All service configurations unless explicitly excluded are a part of the child service definition.
> *1.  Extending stack definition*
> File: <stacks>.<dist_name>.<version_number>.metainfo.xml
> E.g.: /stacks/HDP/1.3.1/metainfo.xml
>  
> {noformat}
> <metainfo>
>     <versions>
>         <upgrade>1.2.0</upgrade>
>     </versions>
>     <active>true</active>
>     <extends>1.3.0</extends>
> </metainfo>
> {noformat}
> *2.  Extending service definition*
> <stacks>.<dist_name>.<version_number>.<service_name>.metainfo.xml
> E.g.: /stacks/HDP/1.2.1/services/HDFS/metainfo.xml
> {noformat}
> <metainfo>
>     <user>root</user>
>     <comment>Apache Hadoop Distributed File System</comment>
>     <version>1.1.2</version>
>     <deleted>false<deleted>
> </metainfo>
> {noformat}
> *2.1 Extending component definition*
> Components can be added or deleted from the stack.
> {noformat}
> <component>
>     <name>YARN_CLIENT</name>
>     <category>CLIENT</category>
>     <deleted>true</deleted>
> </component>
> {noformat}
> *3.  Extending service configurations*
> File: <stacks>.<dist_name>.<version_number>.<service_name>.<configuration>.configuration_file
> E.g.: /stacks/HDP/1.3.1/services/HDFS/configuration/hdfs-site.xml
> {noformat}
> <configuration>
>   <property>
>       <name>dfs.name.dir</name>
>       <deleted>true</deleted>
>   </property>
> </configuration>
> {noformat}
> *Notes*: 
> The same property can disappear and reappear in an extension graph.
> {noformat}
> 1.3.0 ----------------> 1.3.1 ----------------> 1.3.2 ----------------> 1.3.5
> a = b                   a = c                                           a = c
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira