Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B573910363 for ; Wed, 26 Nov 2014 20:36:19 +0000 (UTC) Received: (qmail 1166 invoked by uid 500); 26 Nov 2014 20:36:19 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 1135 invoked by uid 500); 26 Nov 2014 20:36:19 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 1120 invoked by uid 99); 26 Nov 2014 20:36:19 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Nov 2014 20:36:19 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id E80B31DFE97; Wed, 26 Nov 2014 20:36:17 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7587399045228653549==" MIME-Version: 1.0 Subject: Review Request 28480: Alerts: AlertDefinition and AlertGroup Automatic Creation On Startup From: "Jonathan Hurley" To: "Nate Cole" , "Tom Beerbower" Cc: "Ambari" , "Jonathan Hurley" Date: Wed, 26 Nov 2014 20:36:17 -0000 Message-ID: <20141126203617.15978.29713@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Jonathan Hurley" X-ReviewGroup: Ambari X-ReviewRequest-URL: https://reviews.apache.org/r/28480/ X-Sender: "Jonathan Hurley" Reply-To: "Jonathan Hurley" X-ReviewRequest-Repository: ambari --===============7587399045228653549== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- 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 --===============7587399045228653549==--