You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Jonathan Hurley <jh...@hortonworks.com> on 2014/11/26 21:36:17 UTC

Review Request 28480: Alerts: AlertDefinition and AlertGroup Automatic Creation On Startup

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

Review request for Ambari, Nate Cole and Tom Beerbower.


Bugs: AMBARI-8460
    https://issues.apache.org/jira/browse/AMBARI-8460


Repository: ambari


Description
-------

When upgrading to a version of Ambari that supports the new alert framework, the AlertDefinition and AlertGroup tables must be populated with the definitions and default groups for services that are already installed in the cluster.

Most of this is actually taken care of automatically. When Ambari 2.0.0 starts up, it will read all of the services for each cluster and then it will determine if any of the stack alert definitions for that service exist or are new. They will all be new, causing them to be created.

However, the alert groups will not be created automatically for the services. When adding alert definitions, we must ensure that a default group is already created.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java b56f23d 
  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java 8e8c808 
  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java b6c1e90 
  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java 1127dd1 
  ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertGroupEntity.java ac3586d 
  ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java dc71862 
  ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java 0d2d305 
  ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertsDAOTest.java 6467b31 
  ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java 8a162fd 
  ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java 2be5b47 

Diff: https://reviews.apache.org/r/28480/diff/


Testing
-------

New tests added for verifying default alert group creation. Existing tests changed to have valid services in the AlertDefinitions.

Performed a cluster installation, then wiped the database tables for all alerts to simulate a 2.0.0 startup for the first time.


Thanks,

Jonathan Hurley


Re: Review Request 28480: Alerts: AlertDefinition and AlertGroup Automatic Creation On Startup

Posted by Jonathan Hurley <jh...@hortonworks.com>.

> On Nov. 26, 2014, 4:04 p.m., Tom Beerbower wrote:
> >

Thanks for the review!


> On Nov. 26, 2014, 4:04 p.m., Tom Beerbower wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java, line 74
> > <https://reviews.apache.org/r/28480/diff/1/?file=776866#file776866line74>
> >
> >     Used to ??

Better than half of the other comments I've seen in some code. :)

Fixed.


> On Nov. 26, 2014, 4:04 p.m., Tom Beerbower wrote:
> > ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java, line 731
> > <https://reviews.apache.org/r/28480/diff/1/?file=776870#file776870line731>
> >
> >     Need @Test?

Apparently I'm still stuck in JUnit 3 land. Fixed.


- Jonathan


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


On Nov. 26, 2014, 3:36 p.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28480/
> -----------------------------------------------------------
> 
> (Updated Nov. 26, 2014, 3:36 p.m.)
> 
> 
> Review request for Ambari, Nate Cole and Tom Beerbower.
> 
> 
> Bugs: AMBARI-8460
>     https://issues.apache.org/jira/browse/AMBARI-8460
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> When upgrading to a version of Ambari that supports the new alert framework, the AlertDefinition and AlertGroup tables must be populated with the definitions and default groups for services that are already installed in the cluster.
> 
> Most of this is actually taken care of automatically. When Ambari 2.0.0 starts up, it will read all of the services for each cluster and then it will determine if any of the stack alert definitions for that service exist or are new. They will all be new, causing them to be created.
> 
> However, the alert groups will not be created automatically for the services. When adding alert definitions, we must ensure that a default group is already created.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java b56f23d 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java 8e8c808 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java b6c1e90 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java 1127dd1 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertGroupEntity.java ac3586d 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java dc71862 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java 0d2d305 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertsDAOTest.java 6467b31 
>   ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java 8a162fd 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java 2be5b47 
> 
> Diff: https://reviews.apache.org/r/28480/diff/
> 
> 
> Testing
> -------
> 
> New tests added for verifying default alert group creation. Existing tests changed to have valid services in the AlertDefinitions.
> 
> Performed a cluster installation, then wiped the database tables for all alerts to simulate a 2.0.0 startup for the first time.
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>


Re: Review Request 28480: Alerts: AlertDefinition and AlertGroup Automatic Creation On Startup

Posted by Tom Beerbower <tb...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28480/#review63135
-----------------------------------------------------------

Ship it!



ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java
<https://reviews.apache.org/r/28480/#comment105332>

    Used to ??



ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java
<https://reviews.apache.org/r/28480/#comment105333>

    Need @Test?


- Tom Beerbower


On Nov. 26, 2014, 8:36 p.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28480/
> -----------------------------------------------------------
> 
> (Updated Nov. 26, 2014, 8:36 p.m.)
> 
> 
> Review request for Ambari, Nate Cole and Tom Beerbower.
> 
> 
> Bugs: AMBARI-8460
>     https://issues.apache.org/jira/browse/AMBARI-8460
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> When upgrading to a version of Ambari that supports the new alert framework, the AlertDefinition and AlertGroup tables must be populated with the definitions and default groups for services that are already installed in the cluster.
> 
> Most of this is actually taken care of automatically. When Ambari 2.0.0 starts up, it will read all of the services for each cluster and then it will determine if any of the stack alert definitions for that service exist or are new. They will all be new, causing them to be created.
> 
> However, the alert groups will not be created automatically for the services. When adding alert definitions, we must ensure that a default group is already created.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertServiceStateListener.java b56f23d 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAO.java 8e8c808 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java b6c1e90 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java 1127dd1 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertGroupEntity.java ac3586d 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java dc71862 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDispatchDAOTest.java 0d2d305 
>   ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertsDAOTest.java 6467b31 
>   ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java 8a162fd 
>   ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java 2be5b47 
> 
> Diff: https://reviews.apache.org/r/28480/diff/
> 
> 
> Testing
> -------
> 
> New tests added for verifying default alert group creation. Existing tests changed to have valid services in the AlertDefinitions.
> 
> Performed a cluster installation, then wiped the database tables for all alerts to simulate a 2.0.0 startup for the first time.
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>