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

(Updated April 4, 2016, 11:49 a.m.)


Review request for Ambari, Alejandro Fernandez, Dmitro Lisnichenko, Jayush 
Luniya, and Nate Cole.


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


Repository: ambari


Description
-------

When an alert state change is received, its notification will no longer be 
queued for immediate delivery if the firmness of the alert is SOFT. Instead, 
notifications will only be created and queued for delivery if the alert 
firmness is HARD in order to prevent false positives on alerts which have 
repeat tolerance enabled. 

Changes Included in this task:
- Database changes to support HARD/SOFT states to complement repeat occurrence 
values
```
CREATE TABLE alert_current (
  ...
  occurrences BIGINT NOT NULL DEFAULT 1,
  firmness VARCHAR(255) NOT NULL DEFAULT 'HARD',
  ...
);
```

- Changes to eventing system to handle alert state changes difference depending 
on whether the alerts are HARD/SOFT
- HARD/SOFT Calculations
-- If an alert is {{AlertState#OK}}, then the firmness is always 
{{AlertFirmness#HARD}}
-- If an alert is {{link SourceType#AGGREGATE}}, then the firmness is always 
{{link AlertFirmness#HARD}}.
-- Otherwise, the firmness will be {@link AlertFirmness#SOFT} unless the repeat 
tolerance has been met.

- Exposure of HARD/SOFT alert states
```
GET api/v1/clusters/c1/alerts/1
{
  "href": "http://localhost:8080/api/v1/clusters/c1/alerts/1";,
  "Alert": {
    "cluster_name": "c1",
    ...
    "repeat_tolerance": 1,
    "repeat_tolerance_remaining": 0,
    "occurrences": 8,
    "firmness": "HARD"
    ....
```


Diffs (updated)
-----

  
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java
 5a985d6 
  
ambari-server/src/main/java/org/apache/ambari/server/events/AlertStateChangeEvent.java
 60dbec4 
  
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertAggregateListener.java
 0bcfa2f 
  
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
 fbd5c12 
  
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertStateChangedListener.java
 08563e3 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java
 31f2154 
  ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java f91d372 
  ambari-server/src/main/java/org/apache/ambari/server/state/AlertFirmness.java 
PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
 f4a0b8c 
  ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql 2fb2195 
  ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql 6a3712e 
  ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql 964941f 
  ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 366bbeb 
  ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql 
f7e7262 
  ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql bdb6843 
  ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql c6df84a 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AggregateAlertListenerTest.java
 29969d6 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertReceivedListenerTest.java
 7d6c691 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java
 e42e1a7 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/InitialAlertEventTest.java
 3ddeb2a 
  
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
 3723ff8 

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


Testing
-------

mvn clean test


Thanks,

Jonathan Hurley

Reply via email to