You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(927) |
Apr
(419) |
May
(352) |
Jun
(431) |
Jul
(463) |
Aug
(345) |
Sep
(304) |
Oct
(596) |
Nov
(466) |
Dec
(414) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(348) |
Feb
(313) |
Mar
(665) |
Apr
(688) |
May
(434) |
Jun
(311) |
Jul
(540) |
Aug
(554) |
Sep
(467) |
Oct
(341) |
Nov
(365) |
Dec
(272) |
2009 |
Jan
(386) |
Feb
(293) |
Mar
(279) |
Apr
(239) |
May
(229) |
Jun
(199) |
Jul
(186) |
Aug
(111) |
Sep
(196) |
Oct
(146) |
Nov
(116) |
Dec
(140) |
2010 |
Jan
(170) |
Feb
(159) |
Mar
(151) |
Apr
(161) |
May
(90) |
Jun
(56) |
Jul
(28) |
Aug
(22) |
Sep
(5) |
Oct
|
Nov
(23) |
Dec
(12) |
2011 |
Jan
(8) |
Feb
(8) |
Mar
(22) |
Apr
(24) |
May
(4) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <bo...@hy...> - 2009-12-07 22:52:31
|
Author: bob Date: 2009-12-07 14:52:17 -0800 (Mon, 07 Dec 2009) New Revision: 14047 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14047 Modified: branches/HQ_4_1_4_1/etc/version.properties Log: Release 4.1.4.2 build #1077 Modified: branches/HQ_4_1_4_1/etc/version.properties =================================================================== --- branches/HQ_4_1_4_1/etc/version.properties 2009-12-07 21:36:02 UTC (rev 14046) +++ branches/HQ_4_1_4_1/etc/version.properties 2009-12-07 22:52:17 UTC (rev 14047) @@ -1,3 +1,3 @@ -#Tue Sep 29 16:58:36 PDT 2009 +#Mon Dec 07 13:52:22 PST 2009 version=4.1.4.2 -build=1076 +build=1077 |
From: <sc...@hy...> - 2009-12-07 21:36:15
|
Author: scottmf Date: 2009-12-07 13:36:02 -0800 (Mon, 07 Dec 2009) New Revision: 14046 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14046 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java Log: changed logging so that an exception that is handled gracefully and expected is not misunderstood by a user Modified: trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java 2009-12-07 21:31:07 UTC (rev 14045) +++ trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java 2009-12-07 21:36:02 UTC (rev 14046) @@ -1602,8 +1602,12 @@ getOverlord(), server.getEntityId(), false); } catch (ResourceDeletedException e) { log.debug(e); + } catch (AutoinventoryException e) { + log.warn("Exception while turning off RuntimeScan for: " + + server + " (handled gracefully). " + e); } catch (Exception e) { - log.error("Error turning off RuntimeScan for: " + server, e); + log.error("Unexpected error turning off RuntimeScan for: " + + server + " (handled gracefully).", e); } // finally, remove the server getServerManager().removeServer(subject, server); |
From: <sc...@hy...> - 2009-12-07 21:31:19
|
Author: scottmf Date: 2009-12-07 13:31:07 -0800 (Mon, 07 Dec 2009) New Revision: 14045 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14045 Modified: trunk/src/org/hyperic/hq/events/server/session/EventsStartupListener.java Log: [HHQ-3593] hoping that by executing statements in batch it will avoid a small window of time where new RegisteredTriggers with deleted=1 are updated/inserted to avoid foreign key constraint errors. Modified: trunk/src/org/hyperic/hq/events/server/session/EventsStartupListener.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/EventsStartupListener.java 2009-12-07 21:30:43 UTC (rev 14044) +++ trunk/src/org/hyperic/hq/events/server/session/EventsStartupListener.java 2009-12-07 21:31:07 UTC (rev 14045) @@ -83,7 +83,7 @@ triggerEvents.add(TriggersCreatedZevent.class); ZeventManager.getInstance().addBufferedListener( - triggerEvents, new TriggersCreatedListener()); + triggerEvents, new TriggersCreatedListener()); cleanupRegisteredTriggers(); } @@ -91,34 +91,63 @@ private void cleanupRegisteredTriggers() { Connection conn = null; Statement stmt = null; + Boolean autocommit = null; + boolean commit = false; try { conn = DBUtil.getConnByContext( new InitialContext(), HQConstants.DATASOURCE); + autocommit = Boolean.valueOf(conn.getAutoCommit()); + conn.setAutoCommit(false); stmt = conn.createStatement(); - int rows = stmt.executeUpdate( + stmt.addBatch( "update EAM_ALERT_CONDITION set trigger_id = null " + "WHERE exists (" + "select 1 from EAM_ALERT_DEFINITION WHERE deleted = '1' " + "AND EAM_ALERT_CONDITION.alert_definition_id = id" + ")"); - _log.info("disassociated " + rows + " triggers in EAM_ALERT_CONDITION" + - " from their deleted alert definitions"); - rows = stmt.executeUpdate( + stmt.addBatch( "delete from EAM_REGISTERED_TRIGGER WHERE exists (" + "select 1 from EAM_ALERT_DEFINITION WHERE deleted = '1' " + "AND EAM_REGISTERED_TRIGGER.alert_definition_id = id" + ")"); - _log.info("deleted " + rows + " rows from EAM_REGISTERED_TRIGGER"); + int[] rows = stmt.executeBatch(); + conn.commit(); + commit = true; + _log.info("disassociated " + rows[0] + " triggers in EAM_ALERT_CONDITION" + + " from their deleted alert definitions"); + _log.info("deleted " + rows[1] + " rows from EAM_REGISTERED_TRIGGER"); } catch (SQLException e) { _log.error(e, e); } catch (NamingException e) { _log.error(e, e); } finally { + resetAutocommit(conn, autocommit); + if (!commit) rollback(conn); DBUtil.closeJDBCObjects( EventsStartupListener.class.getName(), conn, stmt, null); } } + private void rollback(Connection conn) { + try { + if (conn != null) { + conn.rollback(); + } + } catch (SQLException e) { + _log.error(e, e); + } + } + + private void resetAutocommit(Connection conn, Boolean autocommit) { + try { + if (autocommit != null) { + conn.setAutoCommit(autocommit.booleanValue()); + } + } catch (SQLException e) { + _log.error(e, e); + } + } + private void loadConfigProps(String prop) { try { String property = System.getProperty(prop); |
From: <sc...@hy...> - 2009-12-07 21:30:56
|
Author: scottmf Date: 2009-12-07 13:30:43 -0800 (Mon, 07 Dec 2009) New Revision: 14044 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14044 Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/EventsStartupListener.java Log: [HHQ-3593] hoping that by executing statements in batch it will avoid a small window of time where new RegisteredTriggers with deleted=1 are updated/inserted to avoid foreign key constraint errors. Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/EventsStartupListener.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/EventsStartupListener.java 2009-12-07 21:27:23 UTC (rev 14043) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/EventsStartupListener.java 2009-12-07 21:30:43 UTC (rev 14044) @@ -83,7 +83,7 @@ triggerEvents.add(TriggersCreatedZevent.class); ZeventManager.getInstance().addBufferedListener( - triggerEvents, new TriggersCreatedListener()); + triggerEvents, new TriggersCreatedListener()); cleanupRegisteredTriggers(); } @@ -91,34 +91,63 @@ private void cleanupRegisteredTriggers() { Connection conn = null; Statement stmt = null; + Boolean autocommit = null; + boolean commit = false; try { conn = DBUtil.getConnByContext( new InitialContext(), HQConstants.DATASOURCE); + autocommit = Boolean.valueOf(conn.getAutoCommit()); + conn.setAutoCommit(false); stmt = conn.createStatement(); - int rows = stmt.executeUpdate( + stmt.addBatch( "update EAM_ALERT_CONDITION set trigger_id = null " + "WHERE exists (" + "select 1 from EAM_ALERT_DEFINITION WHERE deleted = '1' " + "AND EAM_ALERT_CONDITION.alert_definition_id = id" + ")"); - _log.info("disassociated " + rows + " triggers in EAM_ALERT_CONDITION" + - " from their deleted alert definitions"); - rows = stmt.executeUpdate( + stmt.addBatch( "delete from EAM_REGISTERED_TRIGGER WHERE exists (" + "select 1 from EAM_ALERT_DEFINITION WHERE deleted = '1' " + "AND EAM_REGISTERED_TRIGGER.alert_definition_id = id" + ")"); - _log.info("deleted " + rows + " rows from EAM_REGISTERED_TRIGGER"); + int[] rows = stmt.executeBatch(); + conn.commit(); + commit = true; + _log.info("disassociated " + rows[0] + " triggers in EAM_ALERT_CONDITION" + + " from their deleted alert definitions"); + _log.info("deleted " + rows[1] + " rows from EAM_REGISTERED_TRIGGER"); } catch (SQLException e) { _log.error(e, e); } catch (NamingException e) { _log.error(e, e); } finally { + resetAutocommit(conn, autocommit); + if (!commit) rollback(conn); DBUtil.closeJDBCObjects( EventsStartupListener.class.getName(), conn, stmt, null); } } + private void rollback(Connection conn) { + try { + if (conn != null) { + conn.rollback(); + } + } catch (SQLException e) { + _log.error(e, e); + } + } + + private void resetAutocommit(Connection conn, Boolean autocommit) { + try { + if (autocommit != null) { + conn.setAutoCommit(autocommit.booleanValue()); + } + } catch (SQLException e) { + _log.error(e, e); + } + } + private void loadConfigProps(String prop) { try { String property = System.getProperty(prop); |
From: <sc...@hy...> - 2009-12-07 21:27:40
|
Author: scottmf Date: 2009-12-07 13:27:23 -0800 (Mon, 07 Dec 2009) New Revision: 14043 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14043 Modified: trunk/src/org/hyperic/hq/bizapp/server/trigger/conditional/ValueChangeTrigger.java Log: [HHQ-3590] changed the datamanager api that initializeLastValue() calls to retrieve the last datapoints. The getLastHistoricalData(Measurement) performs much better. Modified: trunk/src/org/hyperic/hq/bizapp/server/trigger/conditional/ValueChangeTrigger.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/trigger/conditional/ValueChangeTrigger.java 2009-12-07 21:22:25 UTC (rev 14042) +++ trunk/src/org/hyperic/hq/bizapp/server/trigger/conditional/ValueChangeTrigger.java 2009-12-07 21:27:23 UTC (rev 14043) @@ -1,27 +1,32 @@ /* - * NOTE: This copyright doesnot cover user programs that use HQ program services - * by normal system calls through the application program interfaces provided as - * part of the Hyperic Plug-in Development Kit or the Hyperic Client Development - * Kit - this is merely considered normal use of the program, and doesnot fall - * under the heading of "derived work". Copyright (C) [2004, 2005, 2006], - * Hyperic, Inc. This file is part of HQ. HQ is free software; you can - * redistribute it and/or modify it under the terms version 2 of the GNU General - * Public License as published by the Free Software Foundation. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004-2009], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. */ package org.hyperic.hq.bizapp.server.trigger.conditional; import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; import java.util.Locale; -import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -37,14 +42,13 @@ import org.hyperic.hq.events.server.session.AlertConditionEvaluator; import org.hyperic.hq.events.shared.AlertConditionValue; import org.hyperic.hq.events.shared.RegisteredTriggerValue; -import org.hyperic.hq.measurement.MeasurementConstants; import org.hyperic.hq.measurement.UnitsConvert; import org.hyperic.hq.measurement.ext.MeasurementEvent; +import org.hyperic.hq.measurement.server.session.DataManagerEJBImpl; import org.hyperic.hq.measurement.server.session.Measurement; +import org.hyperic.hq.measurement.server.session.MeasurementManagerEJBImpl; import org.hyperic.hq.measurement.shared.DataManagerLocal; -import org.hyperic.hq.measurement.shared.DataManagerUtil; import org.hyperic.hq.measurement.shared.MeasurementManagerLocal; -import org.hyperic.hq.measurement.shared.MeasurementManagerUtil; import org.hyperic.hq.product.MetricValue; import org.hyperic.util.config.ConfigResponse; import org.hyperic.util.config.ConfigSchema; @@ -67,8 +71,8 @@ ValueChangeTrigger.class); } - private static final MessageFormat MESSAGE_FMT = new MessageFormat("Current value ({0}) differs from previous value ({1})."); - + private static final MessageFormat MESSAGE_FMT = + new MessageFormat("Current value ({0}) differs from previous value ({1})."); private final Object lock = new Object(); private Integer measurementId; private MeasurementEvent last = null; @@ -88,8 +92,8 @@ * @see org.hyperic.hq.bizapp.server.trigger.conditional.ConditionalTriggerInterface#getConfigResponse(org.hyperic.hq.appdef.shared.AppdefEntityID, * org.hyperic.hq.events.shared.AlertConditionValue) */ - public ConfigResponse getConfigResponse(AppdefEntityID id, AlertConditionValue cond) throws InvalidOptionException, - InvalidOptionValueException + public ConfigResponse getConfigResponse(AppdefEntityID id, AlertConditionValue cond) + throws InvalidOptionException, InvalidOptionValueException { ConfigResponse resp = new ConfigResponse(); resp.setValue(CFG_ID, String.valueOf(cond.getMeasurementId())); @@ -99,13 +103,15 @@ /** * @see org.hyperic.hq.events.ext.RegisterableTriggerInterface#init(org.hyperic.hq.events.shared.RegisteredTriggerValue) */ - public void init(RegisteredTriggerValue tval, AlertConditionEvaluator alertConditionEvaluator) throws InvalidTriggerDataException + public void init(RegisteredTriggerValue tval, AlertConditionEvaluator alertConditionEvaluator) + throws InvalidTriggerDataException { setId(tval.getId()); setAlertConditionEvaluator(alertConditionEvaluator); try { - ConfigResponse triggerData = ConfigResponse.decode(getConfigSchema(), tval.getConfig()); + ConfigResponse triggerData = + ConfigResponse.decode(getConfigSchema(), tval.getConfig()); measurementId = Integer.valueOf(triggerData.getValue(CFG_ID)); } catch (InvalidOptionException exc) { throw new InvalidTriggerDataException(exc); @@ -119,22 +125,20 @@ private void initializeLastValue() { try { - MeasurementManagerLocal measurementManager = MeasurementManagerUtil.getLocalHome().create(); - DataManagerLocal dataManager = DataManagerUtil.getLocalHome().create(); - Measurement measurement = measurementManager.getMeasurement(measurementId); - List measurements = new ArrayList(); - measurements.add(measurement); - Map lastDataPoints = dataManager.getLastDataPoints(measurements, MeasurementConstants.TIMERANGE_UNLIMITED); - if(lastDataPoints.get(measurementId) == null) { + MeasurementManagerLocal mMan = MeasurementManagerEJBImpl.getOne(); + DataManagerLocal dMan = DataManagerEJBImpl.getOne(); + Measurement measurement = mMan.getMeasurement(measurementId); + MetricValue val = dMan.getLastHistoricalData(measurement); + if(val == null) { if(log.isDebugEnabled()) { log.debug("No previous values found for measurement " + measurementId); } return; } - MetricValue value = (MetricValue)lastDataPoints.get(measurementId); - this.last = new MeasurementEvent(measurementId,value); + this.last = new MeasurementEvent(measurementId, val); } catch (Exception e) { - log.error("Error initializing last value. Changes from previously stored value will not trigger an alert.",e); + log.error("Error initializing last value. Changes from previously " + + "stored value will not trigger an alert.",e); } } @@ -168,8 +172,9 @@ } MeasurementEvent me = (MeasurementEvent) event; if (!me.getInstanceId().equals(measurementId)) { - throw new EventTypeException("Invalid instance ID passed (" + me.getInstanceId() + ") expected " + - measurementId); + throw new EventTypeException( + "Invalid instance ID passed (" + me.getInstanceId() + + ") expected " + measurementId); } synchronized (lock) { TriggerFiredEvent myEvent = null; @@ -181,7 +186,8 @@ // Get ready to fire myEvent = prepareTriggerFiredEvent(event); double values[] = { me.getValue().getValue(), last.getValue().getValue() }; - FormattedNumber[] fmtValues = UnitsConvert.convertSame(values, me.getUnits(), Locale.getDefault()); + FormattedNumber[] fmtValues = + UnitsConvert.convertSame(values, me.getUnits(), Locale.getDefault()); StringBuffer sb = new StringBuffer(); MESSAGE_FMT.format(fmtValues, sb, null); myEvent.setMessage(sb.toString()); |
From: <sc...@hy...> - 2009-12-07 21:22:38
|
Author: scottmf Date: 2009-12-07 13:22:25 -0800 (Mon, 07 Dec 2009) New Revision: 14042 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14042 Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/bizapp/server/trigger/conditional/ValueChangeTrigger.java Log: [HHQ-3590] changed the datamanager api that initializeLastValue() calls to retrieve the last datapoints. The getLastHistoricalData(Measurement) performs much better. Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/bizapp/server/trigger/conditional/ValueChangeTrigger.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/bizapp/server/trigger/conditional/ValueChangeTrigger.java 2009-12-07 21:14:44 UTC (rev 14041) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/bizapp/server/trigger/conditional/ValueChangeTrigger.java 2009-12-07 21:22:25 UTC (rev 14042) @@ -19,6 +19,7 @@ import java.text.MessageFormat; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.Map; @@ -40,7 +41,9 @@ import org.hyperic.hq.measurement.MeasurementConstants; import org.hyperic.hq.measurement.UnitsConvert; import org.hyperic.hq.measurement.ext.MeasurementEvent; +import org.hyperic.hq.measurement.server.session.DataManagerEJBImpl; import org.hyperic.hq.measurement.server.session.Measurement; +import org.hyperic.hq.measurement.server.session.MeasurementManagerEJBImpl; import org.hyperic.hq.measurement.shared.DataManagerLocal; import org.hyperic.hq.measurement.shared.DataManagerUtil; import org.hyperic.hq.measurement.shared.MeasurementManagerLocal; @@ -119,22 +122,20 @@ private void initializeLastValue() { try { - MeasurementManagerLocal measurementManager = MeasurementManagerUtil.getLocalHome().create(); - DataManagerLocal dataManager = DataManagerUtil.getLocalHome().create(); - Measurement measurement = measurementManager.getMeasurement(measurementId); - List measurements = new ArrayList(); - measurements.add(measurement); - Map lastDataPoints = dataManager.getLastDataPoints(measurements, MeasurementConstants.TIMERANGE_UNLIMITED); - if(lastDataPoints.get(measurementId) == null) { + MeasurementManagerLocal mMan = MeasurementManagerEJBImpl.getOne(); + DataManagerLocal dMan = DataManagerEJBImpl.getOne(); + Measurement measurement = mMan.getMeasurement(measurementId); + MetricValue val = dMan.getLastHistoricalData(measurement); + if(val == null) { if(log.isDebugEnabled()) { log.debug("No previous values found for measurement " + measurementId); } return; } - MetricValue value = (MetricValue)lastDataPoints.get(measurementId); - this.last = new MeasurementEvent(measurementId,value); + this.last = new MeasurementEvent(measurementId, val); } catch (Exception e) { - log.error("Error initializing last value. Changes from previously stored value will not trigger an alert.",e); + log.error("Error initializing last value. Changes from previously " + + "stored value will not trigger an alert.",e); } } |
From: <sc...@hy...> - 2009-12-07 21:14:56
|
Author: scottmf Date: 2009-12-07 13:14:44 -0800 (Mon, 07 Dec 2009) New Revision: 14041 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14041 Modified: trunk/installer/data/db-upgrade.xml Log: [HHQ-3592] added cleanup in sql before adding constraints Modified: trunk/installer/data/db-upgrade.xml =================================================================== --- trunk/installer/data/db-upgrade.xml 2009-12-07 21:13:50 UTC (rev 14040) +++ trunk/installer/data/db-upgrade.xml 2009-12-07 21:14:44 UTC (rev 14041) @@ -10104,6 +10104,12 @@ entry points of deployments--> <schemaSpec version="3.158"> <schema-directSQL> + <statement> + delete from EAM_ALERT_ACTION_LOG where alert_id not in (select id from EAM_ALERT) + </statement> + <statement> + delete from EAM_ALERT_ACTION_LOG where action_id not in (select id from EAM_ACTION) + </statement> <statement targetDB="mysql" fail="false"> ALTER TABLE EAM_ALERT_ACTION_LOG ADD CONSTRAINT FK423FA3CC1AA4E259 FOREIGN KEY (ALERT_ID) REFERENCES EAM_ALERT (ID) ON DELETE CASCADE |
From: <sc...@hy...> - 2009-12-07 21:14:02
|
Author: scottmf Date: 2009-12-07 13:13:50 -0800 (Mon, 07 Dec 2009) New Revision: 14040 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14040 Modified: branches/HQ_4_2_0_PATCH/installer/data/db-upgrade.xml Log: [HHQ-3592] added cleanup in sql before adding constraints Modified: branches/HQ_4_2_0_PATCH/installer/data/db-upgrade.xml =================================================================== --- branches/HQ_4_2_0_PATCH/installer/data/db-upgrade.xml 2009-12-07 17:54:14 UTC (rev 14039) +++ branches/HQ_4_2_0_PATCH/installer/data/db-upgrade.xml 2009-12-07 21:13:50 UTC (rev 14040) @@ -10104,6 +10104,12 @@ entry points of deployments--> <schemaSpec version="3.158"> <schema-directSQL> + <statement> + delete from EAM_ALERT_ACTION_LOG where alert_id not in (select id from EAM_ALERT) + </statement> + <statement> + delete from EAM_ALERT_ACTION_LOG where action_id not in (select id from EAM_ACTION) + </statement> <statement targetDB="mysql" fail="false"> ALTER TABLE EAM_ALERT_ACTION_LOG ADD CONSTRAINT FK423FA3CC1AA4E259 FOREIGN KEY (ALERT_ID) REFERENCES EAM_ALERT (ID) ON DELETE CASCADE |
From: <bo...@hy...> - 2009-12-07 17:54:28
|
Author: bob Date: 2009-12-07 09:54:14 -0800 (Mon, 07 Dec 2009) New Revision: 14039 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14039 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties Log: Release 4.2.0.2 build #1267 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties =================================================================== --- branches/HQ_4_2_0_PATCH/etc/version.properties 2009-12-07 08:55:15 UTC (rev 14038) +++ branches/HQ_4_2_0_PATCH/etc/version.properties 2009-12-07 17:54:14 UTC (rev 14039) @@ -1,3 +1,3 @@ -#Thu Dec 03 21:50:50 PST 2009 +#Mon Dec 07 09:12:37 PST 2009 version=4.2.0.2 -build=1266 +build=1267 |
From: <bo...@hy...> - 2009-12-07 08:55:29
|
Author: bob Date: 2009-12-07 00:55:15 -0800 (Mon, 07 Dec 2009) New Revision: 14038 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14038 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1281 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-12-07 02:44:59 UTC (rev 14037) +++ trunk/etc/version.properties 2009-12-07 08:55:15 UTC (rev 14038) @@ -1,3 +1,3 @@ -#Sun Dec 06 00:17:02 PST 2009 +#Mon Dec 07 00:17:18 PST 2009 version=4.3.0 -build=1280 +build=1281 |
From: <sc...@hy...> - 2009-12-07 02:45:14
|
Author: scottmf Date: 2009-12-06 18:44:59 -0800 (Sun, 06 Dec 2009) New Revision: 14037 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14037 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java trunk/src/org/hyperic/hq/events/server/session/AlertDAO.java trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java Log: [HHQ-3534] batched up deleting of alerts by alert definition. Lowered the batch size when deleting resource alert info to make sure it does not fail. Modified: trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-12-07 02:42:31 UTC (rev 14036) +++ trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-12-07 02:44:59 UTC (rev 14037) @@ -1840,7 +1840,7 @@ final boolean debug = log.isDebugEnabled(); final AlertDefinitionManagerLocal adm = getADM(); final List alertDefs = getADM().getAllDeletedAlertDefs(); - final int batchSize = 1000; + final int batchSize = 500; for (int i=0; i<alertDefs.size(); i+=batchSize) { final int end = Math.min(i+batchSize, alertDefs.size()); final List sublist = alertDefs.subList(i, end); Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDAO.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDAO.java 2009-12-07 02:42:31 UTC (rev 14036) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDAO.java 2009-12-07 02:44:59 UTC (rev 14037) @@ -48,6 +48,10 @@ super(Alert.class, f); } + public Alert getById(Integer id) { + return (Alert)super.get(id); + } + public Alert findById(Integer id) { return (Alert)super.findById(id); } @@ -292,10 +296,28 @@ // last alert will eventually be put into the map lastAlerts.put(a.getAlertDefinition().getId(), a); } - return lastAlerts; } + + /** + * @param {@link List} of {@link AlertDefinition}s + * Deletes all {@link Alert}s associated with the {@link AlertDefinition}s + */ + int deleteByAlertDefinitions(List alertDefs) { + String sql = "DELETE FROM Alert WHERE alertDefinition in (:alertDefs)"; + int rtn = 0; + for (int i=0; i<alertDefs.size(); i+=BATCH_SIZE) { + int end = Math.min(i+BATCH_SIZE, alertDefs.size()); + rtn += getSession().createQuery(sql) + .setParameterList("alertDefs", alertDefs.subList(i, end)) + .executeUpdate(); + } + return rtn; + } + /** + * Deletes all {@link Alert}s associated with the {@link AlertDefinition} + */ int deleteByAlertDefinition(AlertDefinition def) { String sql = "DELETE FROM Alert WHERE alertDefinition = :alertDef"; Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-12-07 02:42:31 UTC (rev 14036) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-12-07 02:44:59 UTC (rev 14037) @@ -796,14 +796,19 @@ final AlertDefinitionDAO aDao = getAlertDefDAO(); final ActionDAO actionDAO = getActionDAO(); try { + final List alertDefs = new ArrayList(alertDefIds.size()); for (final Iterator i = alertDefIds.iterator(); i.hasNext();) { final Integer alertdefId = (Integer) i.next(); final AlertDefinition alertdef = aDao.findById(alertdefId); + alertDefs.add(alertdef); + } + // Delete the alerts + if (debug) watch.markTimeBegin("deleteByAlertDefinition"); + dao.deleteByAlertDefinitions(alertDefs); + if (debug) watch.markTimeEnd("deleteByAlertDefinition"); - // Delete the alerts - if (debug) watch.markTimeBegin("deleteByAlertDefinition"); - dao.deleteByAlertDefinition(alertdef); - if (debug) watch.markTimeEnd("deleteByAlertDefinition"); + for (final Iterator i = alertDefs.iterator(); i.hasNext();) { + final AlertDefinition alertdef = (AlertDefinition) i.next(); // Remove the conditions if (debug) watch.markTimeBegin("remove conditions and triggers"); @@ -827,6 +832,7 @@ aDao.remove(alertdef); if (debug) watch.markTimeEnd("remove"); } + } finally { if (debug) log.debug("deleted " + alertDefIds.size() + " alertDefs: " + watch); } Modified: trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java 2009-12-07 02:42:31 UTC (rev 14036) +++ trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java 2009-12-07 02:44:59 UTC (rev 14037) @@ -343,6 +343,9 @@ if (alertId == null) { continue; } + if (log.getResource().isInAsyncDeleteState()) { + continue; + } AlertFiredEvent alertFired = createAlertFiredEvent(alertDefId, alertId, log); rtn.put(alertDefId, alertFired); |
From: <sc...@hy...> - 2009-12-07 02:42:43
|
Author: scottmf Date: 2009-12-06 18:42:31 -0800 (Sun, 06 Dec 2009) New Revision: 14036 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14036 Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDAO.java branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/EventLogDAO.java Log: [HHQ-3534] batched up deleting of alerts by alert definition. Lowered the batch size when deleting resource alert info to make sure it does not fail. Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-12-07 02:32:49 UTC (rev 14035) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-12-07 02:42:31 UTC (rev 14036) @@ -1841,7 +1841,7 @@ final boolean debug = log.isDebugEnabled(); final AlertDefinitionManagerLocal adm = getADM(); final List alertDefs = getADM().getAllDeletedAlertDefs(); - final int batchSize = 1000; + final int batchSize = 500; for (int i=0; i<alertDefs.size(); i+=batchSize) { final int end = Math.min(i+batchSize, alertDefs.size()); final List sublist = alertDefs.subList(i, end); Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDAO.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDAO.java 2009-12-07 02:32:49 UTC (rev 14035) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDAO.java 2009-12-07 02:42:31 UTC (rev 14036) @@ -256,6 +256,22 @@ return null; } } + + /** + * @param {@link List} of {@link AlertDefinition}s + * Deletes all {@link Alert}s associated with the {@link AlertDefinition}s + */ + int deleteByAlertDefinitions(List alertDefs) { + String sql = "DELETE FROM Alert WHERE alertDefinition in (:alertDefs)"; + int rtn = 0; + for (int i=0; i<alertDefs.size(); i+=BATCH_SIZE) { + int end = Math.min(i+BATCH_SIZE, alertDefs.size()); + rtn += getSession().createQuery(sql) + .setParameterList("alertDefs", alertDefs.subList(i, end)) + .executeUpdate(); + } + return rtn; + } int deleteByAlertDefinition(AlertDefinition def) { String sql = "DELETE FROM Alert WHERE alertDefinition = :alertDef"; Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-12-07 02:32:49 UTC (rev 14035) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-12-07 02:42:31 UTC (rev 14036) @@ -762,14 +762,19 @@ final AlertDefinitionDAO aDao = getAlertDefDAO(); final ActionDAO actionDAO = getActionDAO(); try { + final List alertDefs = new ArrayList(alertDefIds.size()); for (final Iterator i = alertDefIds.iterator(); i.hasNext();) { final Integer alertdefId = (Integer) i.next(); final AlertDefinition alertdef = aDao.findById(alertdefId); + alertDefs.add(alertdef); + } + // Delete the alerts + if (debug) watch.markTimeBegin("deleteByAlertDefinition"); + dao.deleteByAlertDefinitions(alertDefs); + if (debug) watch.markTimeEnd("deleteByAlertDefinition"); - // Delete the alerts - if (debug) watch.markTimeBegin("deleteByAlertDefinition"); - dao.deleteByAlertDefinition(alertdef); - if (debug) watch.markTimeEnd("deleteByAlertDefinition"); + for (final Iterator i = alertDefs.iterator(); i.hasNext();) { + final AlertDefinition alertdef = (AlertDefinition) i.next(); // Remove the conditions if (debug) watch.markTimeBegin("remove conditions and triggers"); Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/EventLogDAO.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/EventLogDAO.java 2009-12-07 02:32:49 UTC (rev 14035) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/EventLogDAO.java 2009-12-07 02:42:31 UTC (rev 14036) @@ -343,6 +343,9 @@ if (alertId == null) { continue; } + if (log.getResource().isInAsyncDeleteState()) { + continue; + } AlertFiredEvent alertFired = createAlertFiredEvent(alertDefId, alertId, log); rtn.put(alertDefId, alertFired); |
From: <sc...@hy...> - 2009-12-07 02:33:02
|
Author: scottmf Date: 2009-12-06 18:32:49 -0800 (Sun, 06 Dec 2009) New Revision: 14035 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14035 Modified: trunk/src/org/hyperic/hq/measurement/server/session/ReportProcessorEJBImpl.java Log: [HHQ-3588] added timings. fixed potential for NPEs when resource is in async delete mode. Modified: trunk/src/org/hyperic/hq/measurement/server/session/ReportProcessorEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/ReportProcessorEJBImpl.java 2009-12-07 02:30:30 UTC (rev 14034) +++ trunk/src/org/hyperic/hq/measurement/server/session/ReportProcessorEJBImpl.java 2009-12-07 02:32:49 UTC (rev 14035) @@ -35,8 +35,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.hyperic.hq.appdef.Agent; +import org.hyperic.hq.appdef.server.session.Platform; import org.hyperic.hq.appdef.server.session.PlatformManagerEJBImpl; +import org.hyperic.hq.appdef.server.session.Server; import org.hyperic.hq.appdef.server.session.ServerManagerEJBImpl; +import org.hyperic.hq.appdef.server.session.Service; import org.hyperic.hq.appdef.server.session.ServiceManagerEJBImpl; import org.hyperic.hq.appdef.shared.AppdefEntityID; import org.hyperic.hq.appdef.shared.PlatformNotFoundException; @@ -57,6 +61,7 @@ import org.hyperic.hq.measurement.shared.SRNManagerLocal; import org.hyperic.hq.product.MetricValue; import org.hyperic.util.StringUtil; +import org.hyperic.util.timer.StopWatch; /** * @ejb:bean name="ReportProcessor" @@ -80,6 +85,7 @@ MetricValue[] vals) { final boolean debug = _log.isDebugEnabled(); + final StopWatch watch = new StopWatch(); for (int i=0; i<vals.length; i++) { final long now = @@ -94,27 +100,33 @@ } else { points.add(pt); } + if (debug) watch.markTimeBegin("getTemplate"); if (debug && m.getTemplate().isAvailability()) { _log.debug("availability -> " + pt); } + if (debug) watch.markTimeEnd("getTemplate"); } catch(NumberFormatException e) { _log.warn("Unable to insert: " + e.getMessage() + ", metric id=" + m); } } + if (debug) _log.debug(watch); } - private boolean isPriority(long timestamp, long metricTimestamp) { + private final boolean isPriority(long timestamp, long metricTimestamp) { if (metricTimestamp >= (timestamp-PRIORITY_OFFSET)) { return true; } return false; } - private void addData(List points, List priorityPts, Measurement m, - MetricValue[] dpts) - { + private final void addData(List points, List priorityPts, Measurement m, + MetricValue[] dpts) { + final boolean debug = _log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + if (debug) watch.markTimeBegin("getInterval"); long interval = m.getInterval(); + if (debug) watch.markTimeEnd("getInterval"); // Safeguard against an anomaly if (interval <= 0) { @@ -126,18 +138,25 @@ // values for that cycle. MetricValue[] passThroughs = new MetricValue[dpts.length]; - for (int i = 0; i < dpts.length; i++) - { + for (int i = 0; i < dpts.length; i++) { // Save data point to DB. + if (debug) watch.markTimeBegin("getTimestamp"); long retrieval = dpts[i].getTimestamp(); + if (debug) watch.markTimeEnd("getTimestamp"); + if (debug) watch.markTimeBegin("roundDownTime"); long adjust = TimingVoodoo.roundDownTime(retrieval, interval); + if (debug) watch.markTimeEnd("roundDownTime"); // Create new Measurement data point with the adjusted time - MetricValue modified = new MetricValue(dpts[i].getValue(), - adjust); + if (debug) watch.markTimeBegin("new MetricValue"); + MetricValue modified = new MetricValue(dpts[i].getValue(), adjust); + if (debug) watch.markTimeEnd("new MetricValue"); passThroughs[i] = modified; } + if (debug) watch.markTimeBegin("addPoint"); addPoint(points, priorityPts, m, passThroughs); + if (debug) watch.markTimeEnd("addPoint"); + if (debug) _log.debug(watch); } /** @@ -159,9 +178,12 @@ final MeasurementManagerLocal mMan = MeasurementManagerEJBImpl.getOne(); final boolean debug = _log.isDebugEnabled(); + final StopWatch watch = new StopWatch(); for (int i = 0; i < dsnLists.length; i++) { Integer dmId = new Integer(dsnLists[i].getClientId()); + if (debug) watch.markTimeBegin("getMeasurement"); Measurement m = mMan.getMeasurement(dmId); + if (debug) watch.markTimeEnd("getMeasurement"); // Can't do much if we can't look up the derived measurement // If the measurement is enabled, we just throw away their data @@ -173,7 +195,9 @@ continue; } // Need to check if resource was asynchronously deleted (type == null) + if (debug) watch.markTimeBegin("getResource"); final Resource res = m.getResource(); + if (debug) watch.markTimeEnd("getResource"); if (res == null || res.isInAsyncDeleteState()) { if (debug) { _log.debug("dropping metricId=" + m.getId() + @@ -181,16 +205,20 @@ } continue; } + if (debug) watch.markTimeBegin("resMatchesAgent"); if (!resourceMatchesAgent(res, agentToken)) { _log.warn("measurement (id=" + m.getId() + ") was sent to the " + "HQ server from agent (agentToken=" + agentToken + ")" + " but resource (id=" + res.getId() + ") is not associated " + " with that agent. Dropping measurement."); + if (debug) watch.markTimeEnd("resMatchesAgent"); continue; } + if (debug) watch.markTimeEnd("resMatchesAgent"); final boolean isAvail = m.getTemplate().isAvailability(); final ValueList[] valLists = dsnLists[i].getDsns(); + if (debug) watch.markTimeBegin("addData"); for (int j = 0; j < valLists.length; j++) { final MetricValue[] vals = valLists[j].getValues(); if (isAvail) { @@ -199,25 +227,35 @@ addData(dataPoints, null, m, vals); } } + if (debug) watch.markTimeEnd("addData"); } + if (debug) _log.debug(watch); DataInserter d = MeasurementStartupListener.getDataInserter(); + if (debug) watch.markTimeBegin("sendMetricDataToDB"); sendMetricDataToDB(d, dataPoints, false); + if (debug) watch.markTimeEnd("sendMetricDataToDB"); DataInserter a = MeasurementStartupListener.getAvailDataInserter(); + if (debug) watch.markTimeBegin("sendAvailDataToDB"); sendMetricDataToDB(a, availPoints, false); sendMetricDataToDB(a, priorityAvailPts, true); + if (debug) watch.markTimeEnd("sendAvailDataToDB"); // Check the SRNs to make sure the agent is up-to-date SRNManagerLocal srnManager = getSRNManager(); + if (debug) watch.markTimeBegin("reportAgentSRNs"); Collection nonEntities = srnManager.reportAgentSRNs(report.getSRNList()); + if (debug) watch.markTimeEnd("reportAgentSRNs"); if (report.getAgentToken() != null && nonEntities.size() > 0) { // Better tell the agent to stop reporting non-existent entities AppdefEntityID[] entIds = (AppdefEntityID[]) nonEntities.toArray(new AppdefEntityID[nonEntities.size()]); try { + if (debug) watch.markTimeBegin("unschedule"); MeasurementProcessorEJBImpl.getOne().unschedule( report.getAgentToken(), entIds); + if (debug) watch.markTimeEnd("unschedule"); } catch (MeasurementUnscheduleException e) { _log.error("Cannot unschedule entities: " + StringUtil.arrayToString(entIds)); @@ -229,21 +267,72 @@ * checks if the agentToken matches resource's agentToken */ private boolean resourceMatchesAgent(Resource resource, String agentToken) { + if (resource == null || resource.isInAsyncDeleteState()) { + return false; + } final Integer resType = resource.getResourceType().getId(); final Integer aeid = resource.getInstanceId(); try { if (resType.equals(AuthzConstants.authzPlatform)) { - String token = PlatformManagerEJBImpl.getOne().findPlatformById( - aeid).getAgent().getAgentToken(); - return token.equals(agentToken); + Platform p = + PlatformManagerEJBImpl.getOne().findPlatformById(aeid); + Resource r = p.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Agent a = p.getAgent(); + if (a == null) { + return false; + } + return a.getAgentToken().equals(agentToken); } else if (resType.equals(AuthzConstants.authzServer)) { - String token = ServerManagerEJBImpl.getOne().findServerById( - aeid).getPlatform().getAgent().getAgentToken(); - return token.equals(agentToken); + Server server = + ServerManagerEJBImpl.getOne().findServerById(aeid); + Resource r = server.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Platform p = server.getPlatform(); + if (p == null) { + return false; + } + r = p.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Agent a = p.getAgent(); + if (a == null) { + return false; + } + return a.getAgentToken().equals(agentToken); } else if (resType.equals(AuthzConstants.authzService)) { - String token = ServiceManagerEJBImpl.getOne().findServiceById( - aeid).getServer().getPlatform().getAgent().getAgentToken(); - return token.equals(agentToken); + Service service = + ServiceManagerEJBImpl.getOne().findServiceById(aeid); + Resource r = service.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Server server = service.getServer(); + if (server == null) { + return false; + } + r = server.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Platform p = server.getPlatform(); + if (p == null) { + return false; + } + r = p.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Agent a = p.getAgent(); + if (a == null) { + return false; + } + return a.getAgentToken().equals(agentToken); } } catch (PlatformNotFoundException e) { _log.warn("Platform not found Id=" + aeid); |
From: <sc...@hy...> - 2009-12-07 02:30:43
|
Author: scottmf Date: 2009-12-06 18:30:30 -0800 (Sun, 06 Dec 2009) New Revision: 14034 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14034 Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/ReportProcessorEJBImpl.java Log: [HHQ-3588] added timings. fixed potential for NPEs when resource is in async delete mode. Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/ReportProcessorEJBImpl.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/ReportProcessorEJBImpl.java 2009-12-06 09:00:07 UTC (rev 14033) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/measurement/server/session/ReportProcessorEJBImpl.java 2009-12-07 02:30:30 UTC (rev 14034) @@ -35,8 +35,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.hyperic.hq.appdef.Agent; +import org.hyperic.hq.appdef.server.session.Platform; import org.hyperic.hq.appdef.server.session.PlatformManagerEJBImpl; +import org.hyperic.hq.appdef.server.session.Server; import org.hyperic.hq.appdef.server.session.ServerManagerEJBImpl; +import org.hyperic.hq.appdef.server.session.Service; import org.hyperic.hq.appdef.server.session.ServiceManagerEJBImpl; import org.hyperic.hq.appdef.shared.AppdefEntityID; import org.hyperic.hq.appdef.shared.PlatformNotFoundException; @@ -57,6 +61,7 @@ import org.hyperic.hq.measurement.shared.SRNManagerLocal; import org.hyperic.hq.product.MetricValue; import org.hyperic.util.StringUtil; +import org.hyperic.util.timer.StopWatch; /** * @ejb:bean name="ReportProcessor" @@ -80,6 +85,7 @@ MetricValue[] vals) { final boolean debug = _log.isDebugEnabled(); + final StopWatch watch = new StopWatch(); for (int i=0; i<vals.length; i++) { final long now = @@ -94,27 +100,33 @@ } else { points.add(pt); } + if (debug) watch.markTimeBegin("getTemplate"); if (debug && m.getTemplate().isAvailability()) { _log.debug("availability -> " + pt); } + if (debug) watch.markTimeEnd("getTemplate"); } catch(NumberFormatException e) { _log.warn("Unable to insert: " + e.getMessage() + ", metric id=" + m); } } + if (debug) _log.debug(watch); } - private boolean isPriority(long timestamp, long metricTimestamp) { + private final boolean isPriority(long timestamp, long metricTimestamp) { if (metricTimestamp >= (timestamp-PRIORITY_OFFSET)) { return true; } return false; } - private void addData(List points, List priorityPts, Measurement m, - MetricValue[] dpts) - { + private final void addData(List points, List priorityPts, Measurement m, + MetricValue[] dpts) { + final boolean debug = _log.isDebugEnabled(); + StopWatch watch = new StopWatch(); + if (debug) watch.markTimeBegin("getInterval"); long interval = m.getInterval(); + if (debug) watch.markTimeEnd("getInterval"); // Safeguard against an anomaly if (interval <= 0) { @@ -126,18 +138,25 @@ // values for that cycle. MetricValue[] passThroughs = new MetricValue[dpts.length]; - for (int i = 0; i < dpts.length; i++) - { + for (int i = 0; i < dpts.length; i++) { // Save data point to DB. + if (debug) watch.markTimeBegin("getTimestamp"); long retrieval = dpts[i].getTimestamp(); + if (debug) watch.markTimeEnd("getTimestamp"); + if (debug) watch.markTimeBegin("roundDownTime"); long adjust = TimingVoodoo.roundDownTime(retrieval, interval); + if (debug) watch.markTimeEnd("roundDownTime"); // Create new Measurement data point with the adjusted time - MetricValue modified = new MetricValue(dpts[i].getValue(), - adjust); + if (debug) watch.markTimeBegin("new MetricValue"); + MetricValue modified = new MetricValue(dpts[i].getValue(), adjust); + if (debug) watch.markTimeEnd("new MetricValue"); passThroughs[i] = modified; } + if (debug) watch.markTimeBegin("addPoint"); addPoint(points, priorityPts, m, passThroughs); + if (debug) watch.markTimeEnd("addPoint"); + if (debug) _log.debug(watch); } /** @@ -159,9 +178,12 @@ final MeasurementManagerLocal mMan = MeasurementManagerEJBImpl.getOne(); final boolean debug = _log.isDebugEnabled(); + final StopWatch watch = new StopWatch(); for (int i = 0; i < dsnLists.length; i++) { Integer dmId = new Integer(dsnLists[i].getClientId()); + if (debug) watch.markTimeBegin("getMeasurement"); Measurement m = mMan.getMeasurement(dmId); + if (debug) watch.markTimeEnd("getMeasurement"); // Can't do much if we can't look up the derived measurement // If the measurement is enabled, we just throw away their data @@ -173,7 +195,9 @@ continue; } // Need to check if resource was asynchronously deleted (type == null) + if (debug) watch.markTimeBegin("getResource"); final Resource res = m.getResource(); + if (debug) watch.markTimeEnd("getResource"); if (res == null || res.isInAsyncDeleteState()) { if (debug) { _log.debug("dropping metricId=" + m.getId() + @@ -181,16 +205,20 @@ } continue; } + if (debug) watch.markTimeBegin("resMatchesAgent"); if (!resourceMatchesAgent(res, agentToken)) { _log.warn("measurement (id=" + m.getId() + ") was sent to the " + "HQ server from agent (agentToken=" + agentToken + ")" + " but resource (id=" + res.getId() + ") is not associated " + " with that agent. Dropping measurement."); + if (debug) watch.markTimeEnd("resMatchesAgent"); continue; } + if (debug) watch.markTimeEnd("resMatchesAgent"); final boolean isAvail = m.getTemplate().isAvailability(); final ValueList[] valLists = dsnLists[i].getDsns(); + if (debug) watch.markTimeBegin("addData"); for (int j = 0; j < valLists.length; j++) { final MetricValue[] vals = valLists[j].getValues(); if (isAvail) { @@ -199,25 +227,35 @@ addData(dataPoints, null, m, vals); } } + if (debug) watch.markTimeEnd("addData"); } + if (debug) _log.debug(watch); DataInserter d = MeasurementStartupListener.getDataInserter(); + if (debug) watch.markTimeBegin("sendMetricDataToDB"); sendMetricDataToDB(d, dataPoints, false); + if (debug) watch.markTimeEnd("sendMetricDataToDB"); DataInserter a = MeasurementStartupListener.getAvailDataInserter(); + if (debug) watch.markTimeBegin("sendAvailDataToDB"); sendMetricDataToDB(a, availPoints, false); sendMetricDataToDB(a, priorityAvailPts, true); + if (debug) watch.markTimeEnd("sendAvailDataToDB"); // Check the SRNs to make sure the agent is up-to-date SRNManagerLocal srnManager = getSRNManager(); + if (debug) watch.markTimeBegin("reportAgentSRNs"); Collection nonEntities = srnManager.reportAgentSRNs(report.getSRNList()); + if (debug) watch.markTimeEnd("reportAgentSRNs"); if (report.getAgentToken() != null && nonEntities.size() > 0) { // Better tell the agent to stop reporting non-existent entities AppdefEntityID[] entIds = (AppdefEntityID[]) nonEntities.toArray(new AppdefEntityID[nonEntities.size()]); try { + if (debug) watch.markTimeBegin("unschedule"); MeasurementProcessorEJBImpl.getOne().unschedule( report.getAgentToken(), entIds); + if (debug) watch.markTimeEnd("unschedule"); } catch (MeasurementUnscheduleException e) { _log.error("Cannot unschedule entities: " + StringUtil.arrayToString(entIds)); @@ -229,21 +267,72 @@ * checks if the agentToken matches resource's agentToken */ private boolean resourceMatchesAgent(Resource resource, String agentToken) { + if (resource == null || resource.isInAsyncDeleteState()) { + return false; + } final Integer resType = resource.getResourceType().getId(); final Integer aeid = resource.getInstanceId(); try { if (resType.equals(AuthzConstants.authzPlatform)) { - String token = PlatformManagerEJBImpl.getOne().findPlatformById( - aeid).getAgent().getAgentToken(); - return token.equals(agentToken); + Platform p = + PlatformManagerEJBImpl.getOne().findPlatformById(aeid); + Resource r = p.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Agent a = p.getAgent(); + if (a == null) { + return false; + } + return a.getAgentToken().equals(agentToken); } else if (resType.equals(AuthzConstants.authzServer)) { - String token = ServerManagerEJBImpl.getOne().findServerById( - aeid).getPlatform().getAgent().getAgentToken(); - return token.equals(agentToken); + Server server = + ServerManagerEJBImpl.getOne().findServerById(aeid); + Resource r = server.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Platform p = server.getPlatform(); + if (p == null) { + return false; + } + r = p.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Agent a = p.getAgent(); + if (a == null) { + return false; + } + return a.getAgentToken().equals(agentToken); } else if (resType.equals(AuthzConstants.authzService)) { - String token = ServiceManagerEJBImpl.getOne().findServiceById( - aeid).getServer().getPlatform().getAgent().getAgentToken(); - return token.equals(agentToken); + Service service = + ServiceManagerEJBImpl.getOne().findServiceById(aeid); + Resource r = service.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Server server = service.getServer(); + if (server == null) { + return false; + } + r = server.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Platform p = server.getPlatform(); + if (p == null) { + return false; + } + r = p.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + return false; + } + Agent a = p.getAgent(); + if (a == null) { + return false; + } + return a.getAgentToken().equals(agentToken); } } catch (PlatformNotFoundException e) { _log.warn("Platform not found Id=" + aeid); |
From: Scotty <sig...@hy...> - 2009-12-06 18:27:20
|
We have a ppc64-linux sigar binary for HQ 4.x available now. You can get it here: http://svn.hyperic.org/projects/sigar_bin/dist/SIGAR_1_6_3/lib/libsigar-ppc64-linux.so Copy it to the pdk/lib directory of your agent installation to use it. |
From: Scotty <sig...@hy...> - 2009-12-06 18:27:18
|
Windows XP pro: Model=Pentium(R) D CPU 2.80GHz, CacheSize=1024 |
From: <bo...@hy...> - 2009-12-06 09:00:20
|
Author: bob Date: 2009-12-06 01:00:07 -0800 (Sun, 06 Dec 2009) New Revision: 14033 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14033 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1280 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-12-05 08:59:55 UTC (rev 14032) +++ trunk/etc/version.properties 2009-12-06 09:00:07 UTC (rev 14033) @@ -1,3 +1,3 @@ -#Sat Dec 05 00:18:08 PST 2009 +#Sun Dec 06 00:17:02 PST 2009 version=4.3.0 -build=1279 +build=1280 |
From: <bo...@hy...> - 2009-12-05 09:00:10
|
Author: bob Date: 2009-12-05 00:59:55 -0800 (Sat, 05 Dec 2009) New Revision: 14032 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14032 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1279 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-12-04 08:48:57 UTC (rev 14031) +++ trunk/etc/version.properties 2009-12-05 08:59:55 UTC (rev 14032) @@ -1,3 +1,3 @@ -#Fri Dec 04 00:16:55 PST 2009 +#Sat Dec 05 00:18:08 PST 2009 version=4.3.0 -build=1278 +build=1279 |
From: <no...@gi...> - 2009-12-04 18:55:43
|
Branch: refs/heads/hqapi-1.0 Home: http://github.com/hyperic/hqapi Commit: 3d525c01970ad88026f492b98916b792f2c961a6 http://github.com/hyperic/hqapi/commit/3d525c01970ad88026f492b98916b792f2c961a6 Author: Ryan Morgan <rm...@hy...> Date: 2009-12-04 (Fri, 04 Dec 2009) Changed paths: M src/org/hyperic/hq/hqapi1/tools/Command.java Log Message: ----------- [HHQ-3583] Fix handling of -s and --secure CLI arguments. |
From: <no...@gi...> - 2009-12-04 18:55:23
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 3d525c01970ad88026f492b98916b792f2c961a6 http://github.com/hyperic/hqapi/commit/3d525c01970ad88026f492b98916b792f2c961a6 Author: Ryan Morgan <rm...@hy...> Date: 2009-12-04 (Fri, 04 Dec 2009) Changed paths: M src/org/hyperic/hq/hqapi1/tools/Command.java Log Message: ----------- [HHQ-3583] Fix handling of -s and --secure CLI arguments. Commit: a6a9bc55836e0cd04c86aff64c77ac4d801fdbad http://github.com/hyperic/hqapi/commit/a6a9bc55836e0cd04c86aff64c77ac4d801fdbad Author: Ryan Morgan <rm...@hy...> Date: 2009-12-04 (Fri, 04 Dec 2009) Changed paths: M src/org/hyperic/hq/hqapi1/tools/Command.java Log Message: ----------- Merge branch 'hqapi-1.0' into hqapi-2.x Commit: 880bd87c7900d46e75d601cd328f18db3657198c http://github.com/hyperic/hqapi/commit/880bd87c7900d46e75d601cd328f18db3657198c Author: Ryan Morgan <rm...@hy...> Date: 2009-12-04 (Fri, 04 Dec 2009) Changed paths: M ChangeLog Log Message: ----------- Update ChangeLog with fix for HHQ-3583 Commit: 7870fe599ac0a82e8bebcaee4932ba4d8301b9b2 http://github.com/hyperic/hqapi/commit/7870fe599ac0a82e8bebcaee4932ba4d8301b9b2 Author: Ryan Morgan <rm...@hy...> Date: 2009-12-04 (Fri, 04 Dec 2009) Changed paths: M ChangeLog M src/org/hyperic/hq/hqapi1/tools/Command.java Log Message: ----------- Fix merge conflict. |
From: <no...@gi...> - 2009-12-04 18:55:23
|
Branch: refs/heads/hqapi-2.x Home: http://github.com/hyperic/hqapi Commit: 3d525c01970ad88026f492b98916b792f2c961a6 http://github.com/hyperic/hqapi/commit/3d525c01970ad88026f492b98916b792f2c961a6 Author: Ryan Morgan <rm...@hy...> Date: 2009-12-04 (Fri, 04 Dec 2009) Changed paths: M src/org/hyperic/hq/hqapi1/tools/Command.java Log Message: ----------- [HHQ-3583] Fix handling of -s and --secure CLI arguments. Commit: a6a9bc55836e0cd04c86aff64c77ac4d801fdbad http://github.com/hyperic/hqapi/commit/a6a9bc55836e0cd04c86aff64c77ac4d801fdbad Author: Ryan Morgan <rm...@hy...> Date: 2009-12-04 (Fri, 04 Dec 2009) Changed paths: M src/org/hyperic/hq/hqapi1/tools/Command.java Log Message: ----------- Merge branch 'hqapi-1.0' into hqapi-2.x Commit: 880bd87c7900d46e75d601cd328f18db3657198c http://github.com/hyperic/hqapi/commit/880bd87c7900d46e75d601cd328f18db3657198c Author: Ryan Morgan <rm...@hy...> Date: 2009-12-04 (Fri, 04 Dec 2009) Changed paths: M ChangeLog Log Message: ----------- Update ChangeLog with fix for HHQ-3583 |
From: <bo...@hy...> - 2009-12-04 08:49:10
|
Author: bob Date: 2009-12-04 00:48:57 -0800 (Fri, 04 Dec 2009) New Revision: 14031 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14031 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1278 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-12-04 06:25:47 UTC (rev 14030) +++ trunk/etc/version.properties 2009-12-04 08:48:57 UTC (rev 14031) @@ -1,3 +1,3 @@ -#Thu Dec 03 00:17:18 PST 2009 +#Fri Dec 04 00:16:55 PST 2009 version=4.3.0 -build=1277 +build=1278 |
From: <bo...@hy...> - 2009-12-04 06:26:00
|
Author: bob Date: 2009-12-03 22:25:47 -0800 (Thu, 03 Dec 2009) New Revision: 14030 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14030 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties Log: Release 4.2.0.2 build #1266 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties =================================================================== --- branches/HQ_4_2_0_PATCH/etc/version.properties 2009-12-04 05:14:34 UTC (rev 14029) +++ branches/HQ_4_2_0_PATCH/etc/version.properties 2009-12-04 06:25:47 UTC (rev 14030) @@ -1,3 +1,3 @@ -#Tue Dec 01 19:57:48 PST 2009 +#Thu Dec 03 21:50:50 PST 2009 version=4.2.0.2 -build=1265 +build=1266 |
From: <sc...@hy...> - 2009-12-04 05:14:46
|
Author: scottmf Date: 2009-12-03 21:14:34 -0800 (Thu, 03 Dec 2009) New Revision: 14029 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14029 Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java Log: [HHQ-3534] changed method to print debugging info in a finally block just in case it times out and throws an exception Modified: branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-12-04 05:13:49 UTC (rev 14028) +++ branches/HQ_4_2_0_PATCH/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-12-04 05:14:34 UTC (rev 14029) @@ -761,38 +761,41 @@ final AlertDAO dao = getAlertDAO(); final AlertDefinitionDAO aDao = getAlertDefDAO(); final ActionDAO actionDAO = getActionDAO(); - for (final Iterator i = alertDefIds.iterator(); i.hasNext();) { - final Integer alertdefId = (Integer) i.next(); - final AlertDefinition alertdef = aDao.findById(alertdefId); + try { + for (final Iterator i = alertDefIds.iterator(); i.hasNext();) { + final Integer alertdefId = (Integer) i.next(); + final AlertDefinition alertdef = aDao.findById(alertdefId); - // Delete the alerts - if (debug) watch.markTimeBegin("deleteByAlertDefinition"); - dao.deleteByAlertDefinition(alertdef); - if (debug) watch.markTimeEnd("deleteByAlertDefinition"); + // Delete the alerts + if (debug) watch.markTimeBegin("deleteByAlertDefinition"); + dao.deleteByAlertDefinition(alertdef); + if (debug) watch.markTimeEnd("deleteByAlertDefinition"); - // Remove the conditions - if (debug) watch.markTimeBegin("remove conditions and triggers"); - alertdef.clearConditions(); - alertdef.getTriggersBag().clear(); - if (debug) watch.markTimeEnd("remove conditions and triggers"); + // Remove the conditions + if (debug) watch.markTimeBegin("remove conditions and triggers"); + alertdef.clearConditions(); + alertdef.getTriggersBag().clear(); + if (debug) watch.markTimeEnd("remove conditions and triggers"); - // Remove the actions - if (debug) watch.markTimeBegin("removeActions"); - actionDAO.removeActions(alertdef); - if (debug) watch.markTimeEnd("removeActions"); + // Remove the actions + if (debug) watch.markTimeBegin("removeActions"); + actionDAO.removeActions(alertdef); + if (debug) watch.markTimeEnd("removeActions"); - if (debug) watch.markTimeBegin("remove from parent"); - if (alertdef.getParent() != null) { - alertdef.getParent().getChildrenBag().remove(alertdef); + if (debug) watch.markTimeBegin("remove from parent"); + if (alertdef.getParent() != null) { + alertdef.getParent().getChildrenBag().remove(alertdef); + } + if (debug) watch.markTimeEnd("remove from parent"); + + // Actually remove the definition + if (debug) watch.markTimeBegin("remove"); + aDao.remove(alertdef); + if (debug) watch.markTimeEnd("remove"); } - if (debug) watch.markTimeEnd("remove from parent"); - - // Actually remove the definition - if (debug) watch.markTimeBegin("remove"); - aDao.remove(alertdef); - if (debug) watch.markTimeEnd("remove"); + } finally { + if (debug) log.debug("deleted " + alertDefIds.size() + " alertDefs: " + watch); } - if (debug) log.debug("deleted " + alertDefIds.size() + " alertDefs: " + watch); } /** Find an alert definition and return a value object |
From: <sc...@hy...> - 2009-12-04 05:14:04
|
Author: scottmf Date: 2009-12-03 21:13:49 -0800 (Thu, 03 Dec 2009) New Revision: 14028 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14028 Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java Log: [HHQ-3534] changed method to print debugging info in a finally block just in case it times out and throws an exception Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-12-03 22:38:33 UTC (rev 14027) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-12-04 05:13:49 UTC (rev 14028) @@ -795,38 +795,41 @@ final AlertDAO dao = getAlertDAO(); final AlertDefinitionDAO aDao = getAlertDefDAO(); final ActionDAO actionDAO = getActionDAO(); - for (final Iterator i = alertDefIds.iterator(); i.hasNext();) { - final Integer alertdefId = (Integer) i.next(); - final AlertDefinition alertdef = aDao.findById(alertdefId); + try { + for (final Iterator i = alertDefIds.iterator(); i.hasNext();) { + final Integer alertdefId = (Integer) i.next(); + final AlertDefinition alertdef = aDao.findById(alertdefId); - // Delete the alerts - if (debug) watch.markTimeBegin("deleteByAlertDefinition"); - dao.deleteByAlertDefinition(alertdef); - if (debug) watch.markTimeEnd("deleteByAlertDefinition"); + // Delete the alerts + if (debug) watch.markTimeBegin("deleteByAlertDefinition"); + dao.deleteByAlertDefinition(alertdef); + if (debug) watch.markTimeEnd("deleteByAlertDefinition"); - // Remove the conditions - if (debug) watch.markTimeBegin("remove conditions and triggers"); - alertdef.clearConditions(); - alertdef.getTriggersBag().clear(); - if (debug) watch.markTimeEnd("remove conditions and triggers"); + // Remove the conditions + if (debug) watch.markTimeBegin("remove conditions and triggers"); + alertdef.clearConditions(); + alertdef.getTriggersBag().clear(); + if (debug) watch.markTimeEnd("remove conditions and triggers"); - // Remove the actions - if (debug) watch.markTimeBegin("removeActions"); - actionDAO.removeActions(alertdef); - if (debug) watch.markTimeEnd("removeActions"); + // Remove the actions + if (debug) watch.markTimeBegin("removeActions"); + actionDAO.removeActions(alertdef); + if (debug) watch.markTimeEnd("removeActions"); - if (debug) watch.markTimeBegin("remove from parent"); - if (alertdef.getParent() != null) { - alertdef.getParent().getChildrenBag().remove(alertdef); + if (debug) watch.markTimeBegin("remove from parent"); + if (alertdef.getParent() != null) { + alertdef.getParent().getChildrenBag().remove(alertdef); + } + if (debug) watch.markTimeEnd("remove from parent"); + + // Actually remove the definition + if (debug) watch.markTimeBegin("remove"); + aDao.remove(alertdef); + if (debug) watch.markTimeEnd("remove"); } - if (debug) watch.markTimeEnd("remove from parent"); - - // Actually remove the definition - if (debug) watch.markTimeBegin("remove"); - aDao.remove(alertdef); - if (debug) watch.markTimeEnd("remove"); + } finally { + if (debug) log.debug("deleted " + alertDefIds.size() + " alertDefs: " + watch); } - if (debug) log.debug("deleted " + alertDefIds.size() + " alertDefs: " + watch); } /** Find an alert definition and return a value object |