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 6BACE17C4C for ; Tue, 30 Sep 2014 22:38:16 +0000 (UTC) Received: (qmail 69856 invoked by uid 500); 30 Sep 2014 22:38:16 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 69825 invoked by uid 500); 30 Sep 2014 22:38:16 -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 69809 invoked by uid 99); 30 Sep 2014 22:38:15 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2014 22:38:15 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 863881DDB98; Tue, 30 Sep 2014 22:38:12 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============0953102767037603758==" MIME-Version: 1.0 Subject: Review Request 26193: Alerts: An Alert Definition On Demand Execution From: "Jonathan Hurley" To: "Nate Cole" , "Tom Beerbower" Cc: "Ambari" , "Jonathan Hurley" Date: Tue, 30 Sep 2014 22:38:12 -0000 Message-ID: <20140930223812.19041.70301@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/26193/ X-Sender: "Jonathan Hurley" Reply-To: "Jonathan Hurley" X-ReviewRequest-Repository: ambari --===============0953102767037603758== 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/26193/ ----------------------------------------------------------- Review request for Ambari, Nate Cole and Tom Beerbower. Bugs: AMBARI-7568 https://issues.apache.org/jira/browse/AMBARI-7568 Repository: ambari Description ------- An alert should be able to be scheduled for immediate execution. This is independent of its interval scheduling. The on-demand execution should not affect any existing job schedules on the agent for the definition. Alerts run outside of the realm of the normal request/task workflow. Therefore, in order to trigger an on-demand alert to run, the following command is used: POST http://server/api/v1/clusters/{clusterName}/alert_definitions/{alertDefinitionId}?AlertDefinition/run_now=true The most sensible way to accomplish this was to create the new AlertExecutionCommand. I know that we are conservative with our extension of AgentCommand, however alerts falls into a new category since the agent is in charge of all of the scheduling logic. It didn't make sense to make this a custom command since there's no associated Python file to "run"; it's all transmitted in the heartbeat and runs inside of the alerts framework. Diffs ----- ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py c645cba0bb28c909894c9162f904c19f438c3304 ambari-agent/src/main/python/ambari_agent/Controller.py 18df06ed8c1960f670a9d4a5e9d1a7021330b9ea ambari-agent/src/main/python/ambari_agent/alerts/collector.py 9943211eab71d54598fbf58289b1e4171241aa9a ambari-agent/src/test/python/ambari_agent/TestAlerts.py f9c2ab4a93a2d56ae9d7f7d5051d3bc4a71bd1ae ambari-server/src/main/java/org/apache/ambari/server/agent/AgentCommand.java 6e8aab1bf4236ffb129e12da4ff3c475338da299 ambari-server/src/main/java/org/apache/ambari/server/agent/AlertExecutionCommand.java PRE-CREATION ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java c8261539262ede385387919c7c28d9b827acccef ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatResponse.java 1e9dc125556cde334e5bb5ccd2c8c435335d3c89 ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java e2d283728482ea301aff964a0e3e6ea3191b801c ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java 35d77426a9b0cf9373e95d29a48ccb8f1622e96b ambari-server/src/main/resources/properties.json 3893f39c0ce6a862bcbff53791748b6179238bc2 ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertDefinitionHashTest.java 1cb6eac7e57398e6eb0e18e45ed1ba5b4541efdf Diff: https://reviews.apache.org/r/26193/diff/ Testing ------- New tests added; ran the following project targets: ambari-agent$ mvn clean test [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.988 s [INFO] Finished at: 2014-09-30T17:14:20-04:00 [INFO] Final Memory: 8M/81M [INFO] ------------------------------------------------------------------------ ambari-server$ mvn clean test [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 18:51 min [INFO] Finished at: 2014-09-30T18:02:03-04:00 [INFO] Final Memory: 29M/180M [INFO] ------------------------------------------------------------------------ Thanks, Jonathan Hurley --===============0953102767037603758==--