> On May 12, 2016, 7:15 a.m., Sebastian Toader wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java,
> >  line 957
> > <https://reviews.apache.org/r/46944/diff/5/?file=1380170#file1380170line957>
> >
> >     Why 
> >     ```
> >     if (services.containsKey(service.getName())) {
> >             throw new AmbariException("Service already exists" + ", 
> > clusterName="
> >                 + getClusterName() + ", clusterId=" + getClusterId()
> >                 + ", serviceName=" + service.getName());
> >           }
> >     ```
> >     is not needed any more? Is it a valid use case to re-add a service to 
> > an existing cluster?

you can reach this code only from ServiceResourceProvider, that will throw an 
exception before addService (there is a validation about duplicate a service), 
only tests can call this directly, so that code part is not needed


- Oliver


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


On May 12, 2016, 12:58 p.m., Oliver Szabo wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46944/
> -----------------------------------------------------------
> 
> (Updated May 12, 2016, 12:58 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Laszlo Puskas, Myroslav 
> Papirkovskyy, Sumit Mohanty, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-16230
>     https://issues.apache.org/jira/browse/AMBARI-16230
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> 2 different type of errors can occur during adding any new service to Ambari:
> 
> org.apache.ambari.server.AmbariException: Unable to create a default alert 
> group for unknown service <SERVICE_NAME> in cluster
> 
> org.apache.ambari.server.ServiceNotFoundException: Service not found, 
> clusterName=c1, serviceName=<SERVICE_NAME>
> 
> The reason is that: ServiceInstalledEvent can be handled quicker than 
> ServiceImpl.persist() can finish
> 
> 
> Diffs
> -----
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
>  47342f3 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java 
> 303b043 
>   ambari-server/src/main/java/org/apache/ambari/server/state/ServiceImpl.java 
> 487489b 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
>  108732f 
>   ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java 
> a3d05a9 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java 
> 19146fd 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertEventPublisherTest.java
>  d1b27a9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
>  1875ba6 
> 
> Diff: https://reviews.apache.org/r/46944/diff/
> 
> 
> Testing
> -------
> 
> Unit Testing is in progress..
> FT: deploy cluster, add service, restart ambari with deployed cluster.
> 
> 
> Thanks,
> 
> Oliver Szabo
> 
>

Reply via email to