> On May 14, 2014, 8:02 p.m., Sid Wagle wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java,
> >  line 290
> > <https://reviews.apache.org/r/21403/diff/2/?file=581544#file581544line290>
> >
> >     Should be a safety check for NPE, not all API users will provide a 
> > provisioning state.

NULL is an acceptable value here; the ClusterRequest's constructor doesn't try 
to manipulate the provisioning state. ClusterRequest.getProvisioningState() 
also indicates that NULL is a possible return value if the provisioning state 
was not in the request. I expect that in most cases, it will be null.


- Jonathan


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


On May 15, 2014, 9:36 a.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/21403/
> -----------------------------------------------------------
> 
> (Updated May 15, 2014, 9:36 a.m.)
> 
> 
> Review request for Ambari, Nate Cole and Sid Wagle.
> 
> 
> Bugs: AMBARI-5749
>     https://issues.apache.org/jira/browse/AMBARI-5749
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Clients have requested to have the state of cluster provisioning defined in a 
> more structured manner. They currently use the /persist endpoint to store the 
> state of cluster provisioning, which if it becomes corrupted, can place the 
> Ambari Web Client in a bad state.
> 
> We have now exposed a "provisioning_state" property on the cluster resource 
> so allow the client to mark a cluster as being either INIT or INSTALLED. 
> There are no in-between states and once a cluster is marked as INSTALLED, it 
> cannot be reverted back to INIT.
> 
> - New tests added to cover provisioned_state lifecycle states
> - Database scripts updated
> - Database upgrade steps added
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
>  b2151f5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ClusterRequest.java
>  1eaf7c7 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ClusterResponse.java
>  557cf6e 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
>  8b6c39a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterEntity.java
>  b9e18cf 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterStateEntity.java
>  d955a95 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 
> 8955347 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
>  4717498 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
>  51d64d3 
>   
> ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
>  8b4a199 
>   ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql ce01146 
>   ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql c0472bd 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 5792556 
>   ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql 
> 8c07e63 
>   ambari-server/src/main/resources/properties.json a529950 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
>  f2dd4c9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/ClusterRequestTest.java
>  c1ce0f3 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/ClusterResponseTest.java
>  67924a1 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java
>  6f4a74c 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
>  f8bb351 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
>  24bb6d1 
>   
> ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
>  415951f 
> 
> Diff: https://reviews.apache.org/r/21403/diff/
> 
> 
> Testing
> -------
> 
> Results :
> 
> Tests run: 1607, Failures: 0, Errors: 0, Skipped: 14
> 
> OK
> ----------------------------------------------------------------------
> Total run:554
> Total errors:0
> Total failures:0
> 
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 13:35.615s
> [INFO] Finished at: Wed May 14 13:56:57 EDT 2014
> [INFO] Final Memory: 22M/123M
> [INFO] 
> ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>

Reply via email to