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 18363: Add ability to export a blueprint for a running cluster
Date Mon, 24 Feb 2014 15:21:50 GMT


> On Feb. 21, 2014, 11:23 p.m., Tom Beerbower wrote:
> > Looks good.  Just one minor point and a couple of questions...
> > 
> > Should doc for ResourceDefinition.getRenderer(String name) include @throws IllegalArgumentException?
 I guess a user should never expect a null return?
> > 
> > Does each resource type get the opportunity to provide a renderer for a query? 
For example, if you queried for a service and its components does getRenderer() get called
on the BaseResourceDefinition for service and component?
> > 
> > It doesn't look like it is supported now but did you give any thought to allowing
multiple renderers?  Like if someone wanted a minimal blueprint.  That may not make sense
in that case but you get the idea.

Thanks Tom for the review.
Agreed with the javadoc for getRenderer().

Only the renderer for the top level resource is invoked.  So in your example, only the service
would be queried for it's renderer.  This was done to make the Renderer interface simple.
 Now, finalizeProperties() is called once on the top level resource renderer prior to the
query and finalizeResult() is called once after the query.  This renderer may, and all current
implementations do,  make changes to the sub-resource properties an results.

I did give some thought to chaining renderers but decided against it for now since it wasn't
required and it may have negatively impact on the Renderer interface.  So I opted to keep
it simple instead of adding functionality that may never be used.


- John


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


On Feb. 21, 2014, 6:26 p.m., John Speidel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18363/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2014, 6:26 p.m.)
> 
> 
> Review request for Ambari, Mahadev Konar, Nate Cole, Sumit Mohanty, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-4786
>     https://issues.apache.org/jira/browse/AMBARI-4786
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Export a blueprint for a running cluster using an alternate rendering for the cluster
resource.
> This patch also provides the functionality for providing alternate renderings, such as
blueprint for cluster resources.
> Also, the minimal_response=true syntax can now be specified using an alternate rendering
format=minimal for any resource.
> 
> For this change, the blueprint will be very minimal and will only contain node groups
and no configuration. Subsequent patches will introduce configuration and other cluster data.
> 
> 
> GET api/v1/clusters/c1?format=blueprint
> 
> 
> {
>   "host_groups" : [
>     {
>       "name" : "host_group_1",
>       "components" : [
>         {
>           "name" : "HISTORYSERVER"
>         },
>         {
>           "name" : "OOZIE_CLIENT"
>         },
>         {
>           "name" : "JOBTRACKER"
>         },
>         {
>           "name" : "NAMENODE"
>         },
>         {
>           "name" : "OOZIE_SERVER"
>         },
>         {
>           "name" : "TASKTRACKER"
>         },
>         {
>           "name" : "NAGIOS_SERVER"
>         },
>         {
>           "name" : "SECONDARY_NAMENODE"
>         },
>         {
>           "name" : "MAPREDUCE_CLIENT"
>         },
>         {
>           "name" : "AMBARI_SERVER"
>         },
>         {
>           "name" : "GANGLIA_SERVER"
>         },
>         {
>           "name" : "HDFS_CLIENT"
>         },
>         {
>           "name" : "DATANODE"
>         },
>         {
>           "name" : "GANGLIA_MONITOR"
>         }
>       ],
>       "cardinality" : "1"
>     }
>   ],
>   "Blueprints" : {
>     "blueprint_name" : "blueprint-c1",
>     "stack_name" : "HDP",
>     "stack_version" : "1.3.3"
>   }
> }
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/api/handlers/BaseManagementHandler.java
a31a46e 
>   ambari-server/src/main/java/org/apache/ambari/server/api/handlers/ReadHandler.java
3b4cda1 
>   ambari-server/src/main/java/org/apache/ambari/server/api/handlers/RequestHandler.java
381dedb 
>   ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java
5aa04c4 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/Query.java 58c947a 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryImpl.java a7ac498

>   ambari-server/src/main/java/org/apache/ambari/server/api/query/QueryInfo.java PRE-CREATION

>   ambari-server/src/main/java/org/apache/ambari/server/api/query/render/BaseRenderer.java
PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/render/DefaultRenderer.java
PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/render/MinimalRenderer.java
PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/query/render/Renderer.java
PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java
85ca8e5 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
4b0e8e1 
>   ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceDefinition.java
ba69869 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseRequest.java
ed7bc45 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
8bf7836 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/Request.java f2de36e

>   ambari-server/src/main/java/org/apache/ambari/server/api/services/ResultPostProcessorImpl.java
c02e0a2 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/serializers/JsonSerializer.java
15b2f47 
>   ambari-server/src/main/java/org/apache/ambari/server/api/services/serializers/ResultSerializer.java
22b8c88 
>   ambari-server/src/main/java/org/apache/ambari/server/api/util/TreeNode.java ffb41fa

>   ambari-server/src/main/java/org/apache/ambari/server/api/util/TreeNodeImpl.java da7ead4

>   ambari-server/src/main/java/org/apache/ambari/server/controller/spi/ClusterController.java
c50ff7e 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/spi/SchemaFactory.java
PRE-CREATION 
>   ambari-server/src/test/java/org/apache/ambari/server/api/handlers/CreateHandlerTest.java
22356f0 
>   ambari-server/src/test/java/org/apache/ambari/server/api/handlers/DeleteHandlerTest.java
ac84348 
>   ambari-server/src/test/java/org/apache/ambari/server/api/handlers/ReadHandlerTest.java
f1d2ea6 
>   ambari-server/src/test/java/org/apache/ambari/server/api/handlers/UpdateHandlerTest.java
161a61d 
>   ambari-server/src/test/java/org/apache/ambari/server/api/predicate/QueryLexerTest.java
4cffb3b 
>   ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryImplTest.java 12160ff

>   ambari-server/src/test/java/org/apache/ambari/server/api/query/QueryInfoTest.java PRE-CREATION

>   ambari-server/src/test/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRendererTest.java
PRE-CREATION 
>   ambari-server/src/test/java/org/apache/ambari/server/api/query/render/DefaultRendererTest.java
PRE-CREATION 
>   ambari-server/src/test/java/org/apache/ambari/server/api/query/render/MinimalRendererTest.java
PRE-CREATION 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/BaseResourceDefinitionTest.java
152a30b 
>   ambari-server/src/test/java/org/apache/ambari/server/api/resources/ClusterResourceDefinitionTest.java
PRE-CREATION 
>   ambari-server/src/test/java/org/apache/ambari/server/api/services/BaseRequestTest.java
9a68ec4 
>   ambari-server/src/test/java/org/apache/ambari/server/api/services/BaseServiceTest.java
8217b9c 
>   ambari-server/src/test/java/org/apache/ambari/server/api/services/serializers/JsonSerializerTest.java
63eb33a 
> 
> Diff: https://reviews.apache.org/r/18363/diff/
> 
> 
> Testing
> -------
> 
> - all unit tests pass
> - many new unit tests added
> - functional testing of all types of api calls and deployment of cluster via UI
> 
> 
> Thanks,
> 
> John Speidel
> 
>


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