You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Nate Cole (JIRA)" <ji...@apache.org> on 2013/10/22 20:28:45 UTC

[jira] [Commented] (AMBARI-3577) Move service related code in AmbariManagementController to ServiceResourceProvider

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

Nate Cole commented on AMBARI-3577:
-----------------------------------

Looks good.  As you implied, it would be nice to use Guice to inject the members (Clusters, AmbariMetaInfo, ServiceFactory) into ServiceResourceProvider, rather than having helper methods from AMC.  If it's more trouble than it's worth, no worries.  Also please comment with test output.

> Move service related code in AmbariManagementController to ServiceResourceProvider
> ----------------------------------------------------------------------------------
>
>                 Key: AMBARI-3577
>                 URL: https://issues.apache.org/jira/browse/AMBARI-3577
>             Project: Ambari
>          Issue Type: Task
>            Reporter: Tom Beerbower
>            Assignee: Tom Beerbower
>         Attachments: AMBARI-3577.patch
>
>
> With the goal of getting rid of the AmbariManagementController, we should start pushing some of the code out to the resource providers for the different resource types.
> This refactoring will achieve several things :
> # help to get rid of the AmbariManagementController interface and implementation which has become very bloated and difficult to maintain / add to.
> # organize all of the service related code in one place separate from the other resource types.
> # get rid of the layer of abstraction between the resource providers and the AmbariManagementController which prevents us from using things like Predicates (not part of the AMC interface).
> The short term goal should be to move the code that implements the following AmbariManagementController interface methods into the ServiceResourceProvider as private methods and remove the methods from the interface :
> {code}
>   AmbariManagementController
>   public void createServices(Set<ServiceRequest> requests)
>       throws AmbariException, ParentObjectNotFoundException;
>   public Set<ServiceResponse> getServices(Set<ServiceRequest> requests)
>       throws AmbariException;
>   public RequestStatusResponse updateServices(Set<ServiceRequest> requests,
>       Map<String, String> requestProperties, boolean runSmokeTest,
>       boolean reconfigureClients) throws AmbariException;
>   public RequestStatusResponse deleteServices(Set<ServiceRequest> requests)
>       throws AmbariException;
> {code}
> There is some code in the AMC implementation that is common to multiple resource types that doesn't make sense to pull into ServiceResourceProvider.  That code should remain in the AMCImpl for now.  For example ...
> {code}
>   private final Clusters clusters;
>   ...
>   cluster = clusters.getCluster(clusterName);
> {code}
> ... the member clusters is used across multiple resource types.  Using it from the resource providers would require that we expose it through the AMC interface.  I think that is okay for this first step.  Once the AMC is reduced to something manageable, we can revisit. 
> We should move the associated AMCImpl tests as well.



--
This message was sent by Atlassian JIRA
(v6.1#6144)