> On Sept. 3, 2014, 7:12 a.m., Jonathan Hurley wrote: > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java, > > line 52 > > <https://reviews.apache.org/r/25268/diff/1/?file=674129#file674129line52> > > > > Is the JOIN on AlertDefinition needed? Can you just do "WHERE > > alert.alertDefinition.definitionName = :definitionName" ?
Thanks for reviewing! No, it wasn't needed. I was resolving the relationship in my mind and didn't circle back to it. - Nate ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/25268/#review52164 ----------------------------------------------------------- On Sept. 2, 2014, 4:34 p.m., Nate Cole wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/25268/ > ----------------------------------------------------------- > > (Updated Sept. 2, 2014, 4:34 p.m.) > > > Review request for Ambari and Jonathan Hurley. > > > Bugs: AMBARI-7118 > https://issues.apache.org/jira/browse/AMBARI-7118 > > > Repository: ambari > > > Description > ------- > > * Added code to save alert history/current on incoming alerts. > * Code is not necessarily performant (yet) but is functional. > NOTE: it seems like the history/current creation should be in the same > transaction, so modified the entity classes to mark CascadeType.PERSIST. > This can be a discussion point, I just wanted the code in there and working. > > > Diffs > ----- > > ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py cc5be92 > ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py bf8ada6 > > ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java > d0d5a13 > ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java > f2a5886 > > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java > cde61f2 > ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java > e39b900 > > ambari-server/src/main/java/org/apache/ambari/server/state/cluster/AlertDataManager.java > PRE-CREATION > > ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java > a7cc066 > > ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertsDAOTest.java > caeada1 > > ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java > PRE-CREATION > > Diff: https://reviews.apache.org/r/25268/diff/ > > > Testing > ------- > > mvn clean test > > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 20:05.116s > [INFO] Finished at: Tue Sep 02 16:10:19 EDT 2014 > [INFO] Final Memory: 21M/123M > [INFO] > ------------------------------------------------------------------------ > > > Thanks, > > Nate Cole > >
