> On Nov. 17, 2014, 3:49 p.m., Nate Cole wrote:
> > Is there a need for two different types?  A repo_version on a host vs 
> > cluster should look the same, no?
> 
> Alejandro Fernandez wrote:
>     Technically, there is a difference because the Cluster is required to 
> have exactly one stack version in the CURRENT state, whereas a Host may be 
> doing a rolling upgrade and have multiple stack versions INSTALLED, but only 
> switch one of them to CURRENT after a stack-select (such as HDP-select 
> script) has moved all symlinks and no Jobs in the previous stack remain. The 
> difference is so minor that I'm ok with consolidating the UpgradeState and 
> ClusterVersionState enums.
> 
> Nate Cole wrote:
>     I meant in the context of the API.  This patch is definining 2 new types 
> for a stack_version subresource (Resource.Type.ClusterStackVersion and 
> Resource.Type.HostStackVersion).  Can it be ONE type for BOTH hosts and 
> clusters if they return nearly the same elements (say, RepositoryVersion or 
> something)?  I'm not referring to state, version state and upgrade state 
> should remain separate.
> 
> Alejandro Fernandez wrote:
>     I see what you mean. One can certainly extend the other. For example, the 
> subresource for cluster will have additional properties for "installed on 
> hosts", "current on hosts".
> 
> Yurii Shylov wrote:
>     Besides additional properties, there should be also support for PUT 
> request later for ClusterStackVersion. Besides that, I had the similar 
> experience with PrivilegeResourceProvider which was also made generic. 
> Personally I think that it has brought only unnecessary complications, it has 
> became more difficult to support it or to modify custom implementations of 
> that API.

The definition can be shared, even if the resource provider is separate.  You 
can see how to do a conditional check in ResourceInstanceFactoryImpl.java, look 
for ViewInstance.  Based on the keys passed in, decide which resource provider 
to instantiate.


- Nate


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


On Nov. 18, 2014, 7:36 a.m., Yurii Shylov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28124/
> -----------------------------------------------------------
> 
> (Updated Nov. 18, 2014, 7:36 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, Nate 
> Cole, and Tom Beerbower.
> 
> 
> Bugs: AMBARI-8353
>     https://issues.apache.org/jira/browse/AMBARI-8353
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Add stack_versions subresource to /hosts and /clusters 
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterResourceDefinition.java
>  ef907c0 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ClusterStackVersionResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/HostResourceDefinition.java
>  14ed799 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/HostStackVersionResourceDefinition.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
>  9ad37ec 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
>  f75ae11 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java
>  c51722c 
>   
> ambari-server/src/main/java/org/apache/ambari/server/api/services/HostStackVersionService.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
>  2d91462 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ResourceProviderFactory.java
>  212f944 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
>  c198dd6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java
>  PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
>  dbac906 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterVersionDAO.java
>  e2a2e2d 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java
>  8d147a1 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterVersionEntity.java
>  aaf8eed 
>   
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostVersionEntity.java
>  5b1b4f8 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/ClusterVersionState.java
>  72cd541 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/RepositoryVersionState.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/resources/ClusterResourceDefinitionTest.java
>  7296e8d 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/resources/ClusterStackVersionResourceDefinitionTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/resources/HostResourceDefinitionTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/resources/HostStackVersionResourceDefinitionTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/resources/RepositoryVersionResourceDefinitionTest.java
>  c0e625a 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
>  e8ce2f7 
>   
> ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ClusterVersionDAOTest.java
>  42bf009 
>   
> ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostVersionDAOTest.java
>  93f78b2 
> 
> Diff: https://reviews.apache.org/r/28124/diff/
> 
> 
> Testing
> -------
> 
> in progress
> 
> 
> Thanks,
> 
> Yurii Shylov
> 
>

Reply via email to