.classpath | 3 modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc | 2 modules/enterprise/server/ear/pom.xml | 6 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java | 54 - modules/enterprise/server/plugins/alertdef-rhq/pom.xml | 132 ++++ modules/enterprise/server/plugins/alertdef-rhq/src/main/java/org/rhq/enterprise/server/plugins/alertdef/AlertDefinitionServerPluginComponent.java | 325 ++++++++++ modules/enterprise/server/plugins/alertdef-rhq/src/main/resources/META-INF/rhq-serverplugin.xml | 57 + modules/enterprise/server/plugins/pom.xml | 1 8 files changed, 552 insertions(+), 28 deletions(-)
New commits: commit e77339f1bb0b53ca0d4fc60d81ac8002604a70cc Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 8 16:31:04 2013 -0400
Add Server Plugin for injecting factory-installed alert templates for RHQ. This will be used to create pre-defined storage alerting, alhough at the moment it just creates a dummy template for alerting when the rhq agent goes down.
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml index a4f3f6b..3dcd796 100644 --- a/modules/enterprise/server/ear/pom.xml +++ b/modules/enterprise/server/ear/pom.xml @@ -524,6 +524,12 @@
<artifactItem> <groupId>${project.groupId}</groupId> + <artifactId>serverplugin-alertdef-rhq</artifactId> + <version>${project.version}</version> + </artifactItem> + + <artifactItem> + <groupId>${project.groupId}</groupId> <artifactId>rhq-serverplugin-drift</artifactId> <version>${project.version}</version> </artifactItem> diff --git a/modules/enterprise/server/plugins/alertdef-rhq/pom.xml b/modules/enterprise/server/plugins/alertdef-rhq/pom.xml new file mode 100644 index 0000000..842aabf --- /dev/null +++ b/modules/enterprise/server/plugins/alertdef-rhq/pom.xml @@ -0,0 +1,132 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.rhq</groupId> + <artifactId>rhq-enterprise-server-plugins-parent</artifactId> + <version>4.7.0-SNAPSHOT</version> + </parent> + + <groupId>org.rhq</groupId> + <artifactId>serverplugin-alertdef-rhq</artifactId> + <packaging>jar</packaging> + + <name>RHQ Alert Definition Server Plugin</name> + <description>Server side plugin providing RHQ Alert Definition Injection</description> + + <dependencies> + + <!-- Internal Deps --> + + <dependency> + <groupId>org.rhq</groupId> + <artifactId>rhq-core-domain</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.rhq</groupId> + <artifactId>rhq-core-client-api</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + + </dependencies> + + <build> + <plugins> + + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups> + <!-- + <argLine>${jacoco.unit-test.args} -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</argLine> + --> + </configuration> + </plugin> + + </plugins> + </build> + + <profiles> + + <profile> + <id>dev</id> + + <properties> + <rhq.rootDir>../../../../..</rhq.rootDir> + <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir> + <rhq.deploymentDir>${rhq.containerDir}/${rhq.serverPluginDir}</rhq.deploymentDir> + </properties> + + <build> + <plugins> + + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + + <execution> + <id>deploy</id> + <phase>compile</phase> + <configuration> + <target> + <mkdir dir="${rhq.deploymentDir}" /> + <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> + <echo>*** Updating ${deployment.file}...</echo> + <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" /> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + + <execution> + <id>undeploy</id> + <phase>clean</phase> + <configuration> + <target> + <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> + <echo>*** Deleting ${deployment.file}...</echo> + <delete file="${deployment.file}" /> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + + <execution> + <id>deploy-jar-meta-inf</id> + <phase>package</phase> + <configuration> + <target> + <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" /> + <echo>*** Updating META-INF dir in ${deployment.file}...</echo> + <unjar src="${project.build.directory}/${project.build.finalName}.jar" dest="${project.build.outputDirectory}"> + <patternset> + <include name="META-INF/**" /> + </patternset> + </unjar> + <jar destfile="${deployment.file}" manifest="${project.build.outputDirectory}/META-INF/MANIFEST.MF" update="true"> + </jar> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + + </executions> + </plugin> + + </plugins> + </build> + </profile> + </profiles> + +</project> \ No newline at end of file diff --git a/modules/enterprise/server/plugins/alertdef-rhq/src/main/java/org/rhq/enterprise/server/plugins/alertdef/AlertDefinitionServerPluginComponent.java b/modules/enterprise/server/plugins/alertdef-rhq/src/main/java/org/rhq/enterprise/server/plugins/alertdef/AlertDefinitionServerPluginComponent.java new file mode 100644 index 0000000..76c4e28 --- /dev/null +++ b/modules/enterprise/server/plugins/alertdef-rhq/src/main/java/org/rhq/enterprise/server/plugins/alertdef/AlertDefinitionServerPluginComponent.java @@ -0,0 +1,325 @@ +/* + * RHQ Management Platform + * Copyright 2013, Red Hat Middleware LLC, and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.server.plugins.alertdef; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.rhq.core.domain.alert.AlertCondition; +import org.rhq.core.domain.alert.AlertConditionCategory; +import org.rhq.core.domain.alert.AlertConditionOperator; +import org.rhq.core.domain.alert.AlertDampening; +import org.rhq.core.domain.alert.AlertDefinition; +import org.rhq.core.domain.alert.AlertPriority; +import org.rhq.core.domain.alert.BooleanExpression; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.PropertyList; +import org.rhq.core.domain.configuration.PropertyMap; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.domain.criteria.AlertDefinitionCriteria; +import org.rhq.core.domain.criteria.ResourceTypeCriteria; +import org.rhq.core.domain.resource.ResourceType; +import org.rhq.enterprise.server.alert.AlertDefinitionManagerLocal; +import org.rhq.enterprise.server.auth.SubjectManagerLocal; +import org.rhq.enterprise.server.plugin.pc.ControlFacet; +import org.rhq.enterprise.server.plugin.pc.ControlResults; +import org.rhq.enterprise.server.plugin.pc.ServerPluginComponent; +import org.rhq.enterprise.server.plugin.pc.ServerPluginContext; +import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; +import org.rhq.enterprise.server.util.LookupUtil; + +/** + * An alert def server-side plugin component that the server uses to inject alert defintions. + * + * @author Jay Shaughnessy + */ +public class AlertDefinitionServerPluginComponent implements ServerPluginComponent, ControlFacet { + + private final Log log = LogFactory.getLog(AlertDefinitionServerPluginComponent.class); + + static private final List<InjectedAlertDef> injectedAlertDefs; + static private final InjectedAlertDef testTemplate; + + static { + testTemplate = new InjectedAlertDef( // + "RHQAgent", // + "RHQ Agent", // + "TestTemplate", // + "A test template injection"); + + injectedAlertDefs = new ArrayList<InjectedAlertDef>(); + injectedAlertDefs.add(testTemplate); + } + + private ServerPluginContext context; + + @Override + public void initialize(ServerPluginContext context) throws Exception { + this.context = context; + log.debug("The RHQ AlertDefinition plugin has been initialized!!! : " + this); + } + + @Override + public void start() { + boolean injectAtPluginStartup = Boolean.valueOf(context.getPluginConfiguration().getSimpleValue( + "injectAtPluginStartup", "true")); + boolean replaceIfExists = Boolean.valueOf(context.getPluginConfiguration().getSimpleValue("replaceIfExists", + "false")); + + if (injectAtPluginStartup) { + injectAllAlertDefs(replaceIfExists); + } + + log.debug("The RHQ AlertDefinition plugin has started!!! : " + this); + + } + + @Override + public void stop() { + log.debug("The RHQ AlertDefinition plugin has stopped!!! : " + this); + } + + @Override + public void shutdown() { + log.debug("The RHQ AlertDefinition plugin has been shut down!!! : " + this); + } + + @Override + public ControlResults invoke(String name, Configuration parameters) { + ControlResults controlResults = new ControlResults(); + + try { + if (name.equals("listInjectedAlertDefinitions")) { + PropertyList result = new PropertyList("injectedAlertDefinitions"); + for (InjectedAlertDef iad : injectedAlertDefs) { + PropertyMap map = new PropertyMap("injectedAlertDefinition"); + map.put(new PropertySimple(InjectedAlertDef.FIELD_PLUGIN_NAME, iad.getPluginName())); + map.put(new PropertySimple(InjectedAlertDef.FIELD_RESOURCE_TYPE_NAME, iad.getResourceTypeName())); + map.put(new PropertySimple(InjectedAlertDef.FIELD_NAME, iad.getName())); + map.put(new PropertySimple(InjectedAlertDef.FIELD_DESCRIPTION, iad.getDescription())); + result.add(map); + } + controlResults.getComplexResults().put(result); + + } else if (name.equals("injectAllAlertDefinitions")) { + injectAllAlertDefs(Boolean.valueOf(parameters.getSimpleValue("replaceIfExists"))); + + } else if (name.equals("injectAlertDefinition")) { + InjectedAlertDef requestedInjection = new InjectedAlertDef( // + parameters.getSimpleValue(InjectedAlertDef.FIELD_PLUGIN_NAME), // + parameters.getSimpleValue(InjectedAlertDef.FIELD_RESOURCE_TYPE_NAME), // + parameters.getSimpleValue(InjectedAlertDef.FIELD_NAME), null); + boolean injected = false; + for (InjectedAlertDef iad : injectedAlertDefs) { + if (iad.equals(requestedInjection)) { + injectAlertDef(iad, Boolean.valueOf(parameters.getSimpleValue("replaceIfExists", "false"))); + injected = true; + break; + } + } + + if (!injected) { + controlResults + .setError("Unknown requested alert definition. Check spelling: " + requestedInjection); + } + + } else { + controlResults.setError("Unknown control name: " + name); + } + } catch (Throwable t) { + controlResults.setError(t); + } + + return controlResults; + } + + private List<AlertDefinition> injectAllAlertDefs(boolean replaceIfExists) { + + List<AlertDefinition> result = new ArrayList<AlertDefinition>(); + + for (InjectedAlertDef iad : injectedAlertDefs) { + AlertDefinition newAlertDef = injectAlertDef(iad, replaceIfExists); + if (null != newAlertDef) { + result.add(newAlertDef); + } + } + + return result; + } + + private AlertDefinition injectAlertDef(InjectedAlertDef injectedAlertDef, boolean replaceIfExists) { + + AlertDefinition result = null; + ResourceTypeManagerLocal typeManager = LookupUtil.getResourceTypeManager(); + AlertDefinitionManagerLocal alertDefManager = LookupUtil.getAlertDefinitionManager(); + SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager(); + + ResourceTypeCriteria rtc = new ResourceTypeCriteria(); + rtc.addFilterPluginName(injectedAlertDef.getPluginName()); + rtc.addFilterName(injectedAlertDef.getResourceTypeName()); + List<ResourceType> resourceTypes = typeManager.findResourceTypesByCriteria(subjectManager.getOverlord(), rtc); + + if (resourceTypes.isEmpty()) { + return result; + } + + assert 1 == resourceTypes.size() : "Found more than 1 resource type!"; + ResourceType resourceType = resourceTypes.get(0); + + AlertDefinitionCriteria adc = new AlertDefinitionCriteria(); + adc.addFilterName(injectedAlertDef.getName()); + adc.addFilterAlertTemplateResourceTypeId(resourceType.getId()); + List<AlertDefinition> alertDefs = alertDefManager.findAlertDefinitionsByCriteria(subjectManager.getOverlord(), + adc); + + if (!alertDefs.isEmpty()) { + assert 1 == alertDefs.size() : "Found more than 1 existing alert def!"; + + if (!replaceIfExists) { + return result; + } + + int[] alertDefIdArray = new int[1]; + alertDefIdArray[0] = alertDefs.get(0).getId(); + alertDefManager.removeAlertDefinitions(subjectManager.getOverlord(), alertDefIdArray); + } + + int newAlertDefId = 0; + + if (testTemplate.equals(injectedAlertDef)) { + newAlertDefId = injectTestTemplate(resourceType); + } + + adc.addFilterId(newAlertDefId); + alertDefs = alertDefManager.findAlertDefinitionsByCriteria(subjectManager.getOverlord(), adc); + assert 1 == alertDefs.size() : "Found more than 1 new alert def!"; + result = alertDefs.get(0); + + return result; + } + + private int injectTestTemplate(ResourceType resourceType) { + AlertDefinitionManagerLocal alertDefManager = LookupUtil.getAlertDefinitionManager(); + SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager(); + + AlertDefinition newTemplate = new AlertDefinition(); + newTemplate.setName(testTemplate.getName()); + newTemplate.setResourceType(resourceType); + newTemplate.setPriority(AlertPriority.MEDIUM); + newTemplate.setAlertDampening(new AlertDampening(AlertDampening.Category.NONE)); + newTemplate.setConditionExpression(BooleanExpression.ANY); + newTemplate.setRecoveryId(0); + newTemplate.setEnabled(true); + + AlertCondition ac = new AlertCondition(); + ac.setCategory(AlertConditionCategory.AVAILABILITY); + ac.setName(AlertConditionOperator.AVAIL_GOES_DOWN.name()); + + newTemplate.addCondition(ac); + + int newTemplateId = alertDefManager.createAlertDefinitionInNewTransaction(subjectManager.getOverlord(), + newTemplate, null, true); + + return newTemplateId; + } + + private static class InjectedAlertDef { + static public final String FIELD_PLUGIN_NAME = "plugin"; + static public final String FIELD_RESOURCE_TYPE_NAME = "type"; + static public final String FIELD_NAME = "name"; + static public final String FIELD_DESCRIPTION = "description"; + + private String pluginName; + private String resourceTypeName; + private String name; + private String description; + + public InjectedAlertDef(String pluginName, String resourceTypeName, String name, String description) { + super(); + this.pluginName = pluginName; + this.resourceTypeName = resourceTypeName; + this.name = name; + this.description = description; + } + + public String getPluginName() { + return pluginName; + } + + public String getResourceTypeName() { + return resourceTypeName; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((pluginName == null) ? 0 : pluginName.hashCode()); + result = prime * result + ((resourceTypeName == null) ? 0 : resourceTypeName.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + InjectedAlertDef other = (InjectedAlertDef) obj; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + if (pluginName == null) { + if (other.pluginName != null) + return false; + } else if (!pluginName.equals(other.pluginName)) + return false; + if (resourceTypeName == null) { + if (other.resourceTypeName != null) + return false; + } else if (!resourceTypeName.equals(other.resourceTypeName)) + return false; + return true; + } + + @Override + public String toString() { + return "InjectedAlertDef [pluginName=" + pluginName + ", resourceTypeName=" + resourceTypeName + ", name=" + + name + "]"; + } + } + +} diff --git a/modules/enterprise/server/plugins/alertdef-rhq/src/main/resources/META-INF/rhq-serverplugin.xml b/modules/enterprise/server/plugins/alertdef-rhq/src/main/resources/META-INF/rhq-serverplugin.xml new file mode 100644 index 0000000..84ffa91 --- /dev/null +++ b/modules/enterprise/server/plugins/alertdef-rhq/src/main/resources/META-INF/rhq-serverplugin.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<generic-plugin name="AlertDefinitionPlugin" displayName="Alert Definition Injection Plugin" description="Injects Factory Installed Alert Definitions" + package="org.rhq.enterprise.server.plugins.alertdef" version="1.0" apiVersion="1.0" disabledOnDiscovery="false" + xmlns="urn:xmlns:rhq-serverplugin.generic" xmlns:serverplugin="urn:xmlns:rhq-serverplugin" xmlns:c="urn:xmlns:rhq-configuration"> + + serverplugin:help<![CDATA[ + Injects Factory Installed Alert Templates/Definitions. + ]]></serverplugin:help> + + <serverplugin:plugin-component class="AlertDefinitionServerPluginComponent"> + + <serverplugin:control name="listInjectedAlertDefinitions" description="Return a list of the alert definitions injected by this plugin"> + serverplugin:results + <c:list-property name="injectedAlertDefinitions" description="A list of injected Alert Definitions"> + <c:map-property name="injectedAlertDefinition" description="Injected Alert Definition"> + <c:simple-property name="plugin" type="string" summary="true" /> + <c:simple-property name="type" type="string" summary="true" /> + <c:simple-property name="name" type="string" summary="true" /> + <c:simple-property name="description" type="string" summary="true" /> + </c:map-property> + </c:list-property> + </serverplugin:results> + </serverplugin:control> + + <serverplugin:control name="injectAllAlertDefinitions" description="Inject all of the defined alert definitions"> + serverplugin:parameters + <c:simple-property name="replaceIfExists" type="boolean" required="true" default="false" + description="If false do not replace the alert definition if it exists. Otherwise delete and replace. Default is false." /> + </serverplugin:parameters> + </serverplugin:control> + + <serverplugin:control name="injectAlertDefinition" description="Inject the specified alert definition"> + serverplugin:parameters + <c:simple-property name="plugin" type="string" required="true" default="" summary="true" + description="The plugin name" /> + <c:simple-property name="type" type="string" required="true" default="true" summary="true" + description="The resource type name" /> + <c:simple-property name="name" type="string" required="true" default="true" summary="true" + description="The name of the alert definition" /> + <c:simple-property name="replaceIfExists" type="boolean" required="true" default="false" + description="If false do not replace the alert definition if it exists. Otherwise delete and replace. Default is false." /> + </serverplugin:parameters> + </serverplugin:control> + + </serverplugin:plugin-component> + + <!-- custom global config - unrelated to schedules --> + serverplugin:plugin-configuration + <c:simple-property name="injectAtPluginStart" type="boolean" required="true" default="true" + description="If true inject all templates at server plugin start. Otherwise skip injection. See 'replaceIfExists' property, which affects injection behavior. Default is true." /> + <c:simple-property name="replaceIfExists" type="boolean" required="true" default="false" + description="If false do not replace the alert definition if it exists. Otherwise delete and replace. Default is false." /> + </serverplugin:plugin-configuration> + + +</generic-plugin> diff --git a/modules/enterprise/server/plugins/pom.xml b/modules/enterprise/server/plugins/pom.xml index 827bc41..b6a1eb7 100644 --- a/modules/enterprise/server/plugins/pom.xml +++ b/modules/enterprise/server/plugins/pom.xml @@ -53,6 +53,7 @@ <module>alert-subject</module> <module>alert-cli</module> <module>alert-log4j</module> + <module>alertdef-rhq</module> <module>cobbler</module> <module>drift-rhq</module> <!--
commit cc76229460a4c3b5c90e65c6e5530b18de29179a Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 8 16:25:58 2013 -0400
Change the cassandra heartbeat quartz job to be non-volatile because volatile is treated as non-volatile in a Quartz cluster, and was generating logging at 5s intervals. Also, just move the job creation into the existing scheduleJobs method.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java index a80c210..5888896 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java @@ -208,7 +208,6 @@ public class StartupBean implements StartupLocal { //startAgentClients(); // this could be expensive if we have large number of agents so skip it and we'll create them lazily //startEmbeddedAgent(); // this is obsolete - we no longer have an embedded agent registerShutdownListener(); - initCassandraClusterHeartBeatJob(); registerPluginDeploymentScannerJob();
logServerStartedMessage(); @@ -584,7 +583,8 @@ public class StartupBean implements StartupLocal { // Do not check until we are up at least 10 mins, but check every 60 secs thereafter. final long initialDelay = 1000L * 60 * 10; // 10 mins final long interval = 1000L * 60; // 60 secs - schedulerBean.scheduleSimpleRepeatingJob(CheckForSuspectedAgentsJob.class, true, false, initialDelay, interval); + schedulerBean.scheduleSimpleRepeatingJob(CheckForSuspectedAgentsJob.class, true, false, initialDelay, + interval); } catch (Exception e) { log.error("Cannot schedule suspected Agents job.", e); } @@ -614,8 +614,8 @@ public class StartupBean implements StartupLocal { try { final long initialDelay = 1000L * 60 * 5; // 5 mins final long interval = 1000L * 60 * 15; // 15 mins - schedulerBean.scheduleSimpleRepeatingJob(CheckForTimedOutContentRequestsJob.class, true, false, initialDelay, - interval); + schedulerBean.scheduleSimpleRepeatingJob(CheckForTimedOutContentRequestsJob.class, true, false, + initialDelay, interval); } catch (Exception e) { log.error("Cannot schedule check-for-timed-out-artifact-requests job.", e); } @@ -646,9 +646,33 @@ public class StartupBean implements StartupLocal { log.error("Cannot create alert availability duration job.", e); }
+ scheduleCassandraClusterHeartBeatJob(); + return; }
+ private void scheduleCassandraClusterHeartBeatJob() { + String seeds = System.getProperty("rhq.cassandra.seeds"); + if (seeds != null) { + seeds = seeds.replaceAll(";", ","); + } + String jobTrigger = "CassandraClusterHeartBeatTrigger - " + UUID.randomUUID().toString(); + String jobGroup = CassandraClusterHeartBeatJob.JOB_NAME + "Group"; + + JobDataMap jobDataMap = new JobDataMap(); + jobDataMap.put(CassandraClusterHeartBeatJob.KEY_CONNECTION_TIMEOUT, "100"); + jobDataMap.put(CassandraClusterHeartBeatJob.KEY_CASSANDRA_HOSTS, seeds); + + try { + schedulerBean.scheduleRepeatingJob(CassandraClusterHeartBeatJob.JOB_NAME, jobGroup, jobDataMap, + CassandraClusterHeartBeatJob.class, true, false, 3000, 5000); + } catch (SchedulerException e) { + String msg = "Unable to schedule " + CassandraClusterHeartBeatJob.class.getSimpleName() + " job. The " + + "server will reamin in maintenance mode without a manual override."; + log.error(msg, e); + } + } + /** * This seeds the agent clients cache with clients for all known agents. These clients will be started so they can * immediately begin to send any persisted guaranteed messages that might already exist. This method must be called @@ -817,28 +841,6 @@ public class StartupBean implements StartupLocal { return; }
- private void initCassandraClusterHeartBeatJob() { - String seeds = System.getProperty("rhq.cassandra.seeds"); - if (seeds != null) { - seeds=seeds.replaceAll(";", ","); - } - String jobTrigger = "CassandraClusterHeartBeatTrigger - " + UUID.randomUUID().toString(); - String jobGroup = CassandraClusterHeartBeatJob.JOB_NAME + "Group"; - - JobDataMap jobDataMap = new JobDataMap(); - jobDataMap.put(CassandraClusterHeartBeatJob.KEY_CONNECTION_TIMEOUT, "100"); - jobDataMap.put(CassandraClusterHeartBeatJob.KEY_CASSANDRA_HOSTS, seeds); - - try { - schedulerBean.scheduleRepeatingJob(CassandraClusterHeartBeatJob.JOB_NAME, jobGroup, jobDataMap, - CassandraClusterHeartBeatJob.class, true, true, 3000, 5000); - } catch (SchedulerException e) { - String msg = "Unable to schedule " + CassandraClusterHeartBeatJob.class.getSimpleName() + " job. The " + - "server will reamin in maintenance mode without a manual override."; - log.error(msg, e); - } - } - /** * Gets the number of milliseconds since the time when the server was last shutdown. * If we don't know, then return the time since it was started.
commit 7808913b4583b88f1d4c7914fbcd333df269fce9 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed May 8 16:23:11 2013 -0400
more .classpath changes
diff --git a/.classpath b/.classpath index 2e6f36f..f42d022 100644 --- a/.classpath +++ b/.classpath @@ -1,11 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="modules/common/ant-bundle/src/main/java"/> + <classpathentry kind="src" path="modules/enterprise/server/plugins/alertdef-rhq/src/main/java"/> <classpathentry kind="src" path="modules/common/cassandra-util/src/main/java"/> <classpathentry kind="src" path="modules/common/cassandra-ccm/cassandra-ccm-maven-plugin/src/main/java"/> <classpathentry kind="src" path="modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java"/> <classpathentry kind="src" path="modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java"/> <classpathentry kind="src" path="modules/common/cassandra-installer/src/main/java"/> + <classpathentry kind="src" path="modules/common/cassandra-jmx/src/main/java"/> <classpathentry kind="src" path="modules/enterprise/server/server-control/src/main/java"/> <classpathentry kind="src" path="modules/enterprise/server/jar/src/test/java"/> <classpathentry kind="src" path="modules/enterprise/server/itests-2/src/test/java"/> @@ -209,7 +211,6 @@ <classpathentry kind="src" path="modules/common/cassandra-common-itests/src/main/java"/> <classpathentry kind="src" path="modules/enterprise/server/server-metrics/src/test/java"/> <classpathentry kind="src" path="modules/common/cassandra-schema/src/main/java"/> - <classpathentry kind="src" path="modules/common/cassandra-ccm/cassandra-ccm-cli/src/main/java"/> <classpathentry kind="src" path="modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java"/> <classpathentry kind="src" path="modules/common/cassandra-ccm/cassandra-ccm-testng/src/main/java"/> <classpathentry kind="src" path="modules/common/cassandra-ccm/cassandra-ccm-testng/src/test/java"/>
commit 9c040af64396f49148987d257f8a09f90d3c7fbf Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue May 7 16:36:04 2013 -0400
Server needs more permgen, even in dev container
diff --git a/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc b/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc index a7207b1..c1ce814 100644 --- a/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc +++ b/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc @@ -9,7 +9,7 @@ wrapper.java.additional.9=-agentlib:jdwp=transport=dt_socket,address=8787,server wrapper.java.additional.10=-Xms256M wrapper.java.additional.11=-Xmx512M wrapper.java.additional.12=-XX:PermSize=128M -wrapper.java.additional.13=-XX:MaxPermSize=128M +wrapper.java.additional.13=-XX:MaxPermSize=256M
# enable jprofiler #set.PATH=%PATH%;<jprofiler-install-dir>\bin\windows
rhq-commits@lists.fedorahosted.org