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

(Updated Oct. 27, 2015, 11:12 a.m.)


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


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


Repository: ambari


Description
-------

Alert-related SQL queries and updates are responsible for the majority of calls 
to the database in most deployments. This is due to the fact that alerts update 
their timestamp and latest text on every alert, regardless of state change.

This patch introduces an optional, experimental feature where 
`AlertCurrentEntity` instances can be cached. This produces several problems:
- The cached alerts are never reflected in queries from JPA
- The cached alerts are never persisted back to the database

We solve this by keeping the managed entities in memory and flushing them 
periodically. The Alert DAO also augments the list from JPA with cached 
entities.


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/annotations/Experimental.java 
5a4915a 
  
ambari-server/src/main/java/org/apache/ambari/annotations/ExperimentalFeature.java
 PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
 d482ce9 
  
ambari-server/src/main/java/org/apache/ambari/server/api/services/PersistKeyValueService.java
 9b942e5 
  
ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 e97a54e 
  
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java
 e59f63e 
  ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java 
0429534 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java
 66b2a83 
  
ambari-server/src/main/java/org/apache/ambari/server/state/services/CachedAlertFlushService.java
 PRE-CREATION 
  
ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java
 573c02f 

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


Testing
-------

I have already files a Jira to track comprehensive tests: 
https://issues.apache.org/jira/browse/AMBARI-13569

I know that this patch doesn't cover any of the new cached functionality in 
testing, but that's mainly due to the short time constraints and the fact that 
the feature is experimental and off by default.


Thanks,

Jonathan Hurley

Reply via email to