[rhq] modules/common
by Thomas Segismont
modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit f9179b9f96f8e6e4e1a24a4bca076be60faf0e41
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Fri Aug 30 11:14:31 2013 +0200
Fixed StorageInstallerTest: rhq.cassandra.seeds property no longer exists
diff --git a/modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java b/modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java
index a7921c0..43c05b2 100644
--- a/modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java
+++ b/modules/common/cassandra-installer/src/test/java/org/rhq/storage/installer/StorageInstallerTest.java
@@ -188,9 +188,8 @@ public class StorageInstallerTest {
fail("Failed to verify that " + serverPropsFile + " was updated", e);
}
- String seeds = properties.getProperty("rhq.cassandra.seeds");
-
- assertEquals(seeds, "127.0.0.1|7299|9142");
+ assertEquals(properties.getProperty("rhq.storage.nodes"), "127.0.0.1");
+ assertEquals(properties.getProperty("rhq.storage.cql-port"), "9142");
}
private String sha256(File file) {
10 years, 8 months
[rhq] modules/core
by Thomas Segismont
modules/core/domain/intentional-api-changes-since-4.8.0.xml | 89 +++++++-----
1 file changed, 55 insertions(+), 34 deletions(-)
New commits:
commit 9e8c918a9868ab0542e82689c0f4c45ecc4151f7
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Fri Aug 30 10:27:48 2013 +0200
API Check: fix Core Domain module failures
diff --git a/modules/core/domain/intentional-api-changes-since-4.8.0.xml b/modules/core/domain/intentional-api-changes-since-4.8.0.xml
index c6a8f95..cd7a4c4 100644
--- a/modules/core/domain/intentional-api-changes-since-4.8.0.xml
+++ b/modules/core/domain/intentional-api-changes-since-4.8.0.xml
@@ -1,37 +1,58 @@
<?xml version="1.0"?>
<differences>
- <difference>
- <className>org/rhq/core/domain/cloud/StorageNode</className>
- <differenceType>6003</differenceType><!-- Value of compile-time constant has changed -->
- <field>QUERY_FIND_BY_ADDRESS</field>
- <justification>
- Changing StorageNode.QUERY_FIND_BY_ADDRESS. The constants for native queries shouldn't be part of the public API.
- </justification>
- </difference>
- <difference>
- <className>org/rhq/core/domain/cloud/Server</className>
- <differenceType>7004</differenceType><!-- num argments changed -->
- <method>void clearStatus()</method>
- <justification>
- This class is not exposed remotely. The previous method signature was doing a blind clear of the status.
- The new method will clear only the specified status.
- </justification>
- </difference>
- <difference>
- <className>org/rhq/core/domain/operation/OperationHistory</className>
- <differenceType>7012</differenceType><!-- method added -->
- <method>void setStartedTime(long)</method>
- <justification>
- We are adding a method to explicitly set the start time.
- </justification>
- </difference>
- <difference>
- <className>org/rhq/core/domain/configuration/ConfigurationUtility</className>
- <differenceType>7009</differenceType>
- <method>ConfigurationUtility()</method>
- <justification>
- A utility class only marked abstract is protected from instantiation but not from derivation. Its constructor
- should be private.
- </justification>
- </difference>
+ <difference>
+ <className>org/rhq/core/domain/cloud/StorageNode</className>
+ <differenceType>6003</differenceType>
+ <!-- Value of compile-time constant has changed -->
+ <field>QUERY_FIND_BY_ADDRESS</field>
+ <justification>
+ Changing StorageNode.QUERY_FIND_BY_ADDRESS. The constants for native queries shouldn't be part of the public API.
+ </justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/cloud/Server</className>
+ <differenceType>7004</differenceType>
+ <!-- num argments changed -->
+ <method>void clearStatus()</method>
+ <justification>
+ This class is not exposed remotely. The previous method signature was doing a blind clear of the status.
+ The new method will clear only the specified status.
+ </justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/operation/OperationHistory</className>
+ <differenceType>7012</differenceType>
+ <!-- method added -->
+ <method>void setStartedTime(long)</method>
+ <justification>
+ We are adding a method to explicitly set the start time.
+ </justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/configuration/ConfigurationUtility</className>
+ <differenceType>7009</differenceType>
+ <method>ConfigurationUtility()</method>
+ <justification>
+ A utility class only marked abstract is protected from instantiation but not from derivation. Its constructor
+ should be private.
+ </justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/cloud/StorageNode</className>
+ <differenceType>7002</differenceType> <!-- method removed -->
+ <method>java.lang.String getJMXConnectionURL()</method>
+ <justification>No longer needed</justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/cloud/StorageNode</className>
+ <differenceType>7002</differenceType> <!-- method removed -->
+ <method>void parseNodeInformation(java.lang.String)</method>
+ <justification>No longer needed</justification>
+ </difference>
+ <difference>
+ <className>org/rhq/core/domain/cloud/StorageNode</className>
+ <differenceType>7002</differenceType> <!-- method removed -->
+ <method>void setJmxPort(int)</method>
+ <justification>No longer needed</justification>
+ </difference>
</differences>
10 years, 8 months
[rhq] modules/common modules/core modules/enterprise modules/plugins
by snegrea
modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java | 64 +---------
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java | 12 +
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties | 4
modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java | 8 -
modules/core/dbutils/pom.xml | 12 +
modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml | 3
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 8 +
modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java | 34 -----
modules/core/domain/src/test/java/org/rhq/core/domain/cloud/StorageNodeTest.java | 54 +-------
modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml | 20 ++-
modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java | 31 +---
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java | 10 -
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java | 21 +--
modules/enterprise/server/itests-2/pom.xml | 7 -
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBeanTest.java | 9 -
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBeanPreparation.java | 19 +-
modules/enterprise/server/itests-2/src/test/resources/cassandra-test.properties | 7 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java | 17 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java | 4
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java | 38 +++++
modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java | 7 -
21 files changed, 158 insertions(+), 231 deletions(-)
New commits:
commit ca8b82bc0eef209b344c46c122376c8baa8d8ec3
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Fri Aug 30 00:04:55 2013 -0500
Initial commit that migrates storage node properties from rhq.cassandra.* to rhq.storage.*
Tests might not be stable but the rest server and storage node code is complete.
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java b/modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java
index 7c59114..c52f778 100644
--- a/modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java
+++ b/modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java/org/rhq/cassandra/ccm/arquillian/CCMSuiteDeploymentExtension.java
@@ -152,10 +152,13 @@ public class CCMSuiteDeploymentExtension implements LoadableExtension {
}
} else {
try {
- String seed = System.getProperty("rhq.cassandra.seeds", "127.0.0.1|7299|9042");
- nodes = parseNodeAddresses(seed);
- cqlPort = parseNodeCqlPort(seed);
- jmxPorts = parseNodeJmxPorts(seed);
+ String nodesString = System.getProperty("rhq.storage.nodes", "127.0.0.1");
+ nodes = nodesString.split(",");
+
+ String cqlPortString = System.getProperty("rhq.storage.cql-port", "9042");
+ cqlPort = Integer.parseInt(cqlPortString);
+
+ //jmxPorts = parseNodeJmxPorts(seed);
schemaManager = new SchemaManager("rhqadmin", "rhqadmin", nodes, cqlPort);
} catch (Exception e) {
@@ -268,58 +271,5 @@ public class CCMSuiteDeploymentExtension implements LoadableExtension {
throw new RuntimeException("Could not load defined deploymentClass: " + className, e);
}
}
-
- private String[] parseNodeAddresses(String s) {
- String[] unparsedNodes = s.split(",");
-
- String[] nodes = new String[unparsedNodes.length];
-
- for (int index = 0; index < 0; index++) {
- String[] params = unparsedNodes[index].split("\\|");
- if (params.length != 3) {
- throw new IllegalArgumentException(
- "Expected string of the form, hostname|jmxPort|nativeTransportPort: [" + s + "]");
- }
-
- nodes[index] = params[0];
- }
-
- return nodes;
- }
-
- private int[] parseNodeJmxPorts(String s) {
- String[] unparsedNodes = s.split(",");
-
- int[] jmxPorts = new int[unparsedNodes.length];
-
- for (int index = 0; index < 0; index++) {
- String[] params = unparsedNodes[index].split("\\|");
- if (params.length != 3) {
- throw new IllegalArgumentException(
- "Expected string of the form, hostname|jmxPort|nativeTransportPort: [" + s + "]");
- }
-
- jmxPorts[index] = Integer.parseInt(params[1]);
- }
-
- return jmxPorts;
- }
-
- private int parseNodeCqlPort(String s) {
- String[] unparsedNodes = s.split(",");
-
- for (String unparsedNode : unparsedNodes) {
- String[] params = unparsedNode.split("\\|");
- if (params.length != 3) {
- throw new IllegalArgumentException(
- "Expected string of the form, hostname|jmxPort|nativeTransportPort: [" + s + "]");
- }
-
- return Integer.parseInt(params[2]);
- }
-
- throw new IllegalArgumentException("Seed property is not valid [" + s + "]");
- }
-
}
}
\ No newline at end of file
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
index 33e4e25..9bb0372 100644
--- a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
+++ b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
@@ -134,6 +134,9 @@ public class DeploymentOptions {
}
private void init(Properties properties) {
+ setUsername(loadProperty("rhq.storage.username", properties));
+ setPassword(loadProperty("rhq.storage.password", properties));
+
setClusterDir(loadProperty("rhq.cassandra.cluster.dir", properties));
setNumNodes(Integer.parseInt(loadProperty("rhq.cassandra.cluster.num-nodes", properties)));
setEmbedded(Boolean.valueOf(loadProperty("rhq.cassandra.cluster.is-embedded", properties)));
@@ -144,8 +147,6 @@ public class DeploymentOptions {
setRpcPort(Integer.valueOf(loadProperty("rhq.cassandra.rpc-port", properties)));
setNativeTransportMaxThreads(Integer.valueOf(loadProperty("rhq.cassandra.native-transport-max-threads",
properties)));
- setUsername(loadProperty("rhq.cassandra.username", properties));
- setPassword(loadProperty("rhq.cassandra.password", properties));
setAuthenticator(loadProperty("rhq.cassandra.authenticator", properties));
setAuthorizer(loadProperty("rhq.cassandra.authorizer", properties));
setDataDir(loadProperty("rhq.cassandra.data.dir", properties));
@@ -158,6 +159,7 @@ public class DeploymentOptions {
setJmxPort(Integer.valueOf(loadProperty("rhq.cassandra.jmx.port", properties)));
setStoragePort(Integer.valueOf(loadProperty("rhq.cassandra.storage.port", properties)));
setSslStoragePort(Integer.valueOf(loadProperty("rhq.cassandra.ssl.storage.port", properties)));
+
setSeeds(loadProperty("rhq.cassandra.seeds", properties));
setBasedir(loadProperty("rhq.cassandra.basedir", properties));
setHeapSize(loadProperty("rhq.cassandra.max.heap.size", properties));
@@ -353,7 +355,7 @@ public class DeploymentOptions {
nativeTransportPort = port;
}
}
-
+
/**
* @return true whether the Thrift-based RPC should be started
*/
@@ -404,7 +406,7 @@ public class DeploymentOptions {
* <strong>not</strong> a Cassandra configuration property. This deployment property is
* written to rhq-server.properties at build time by the rhq-container.build.xml script.
*/
- @DeploymentProperty(name = "rhq.cassandra.username")
+ @DeploymentProperty(name = "rhq.storage.username")
public String getUsername() {
return username;
}
@@ -426,7 +428,7 @@ public class DeploymentOptions {
* <strong>not</strong> a Cassandra configuration property. This deployment property is
* written to rhq-server.properties at build time by the rhq-container.build.xml script.
*/
- @DeploymentProperty(name = "rhq.cassandra.password")
+ @DeploymentProperty(name = "rhq.storage.password")
public String getPassword() {
return password;
}
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
index 9a1ab75..ebadc27 100644
--- a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
+++ b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
@@ -7,10 +7,10 @@
rhq.cassandra.basedir=${rhq.rootDir}
# The username with which to authenticate requests to Cassandra.
-rhq.cassandra.username=rhqadmin
+rhq.storage.username=rhqadmin
# The password with which to authenticate requests to Cassandra.
-rhq.cassandra.password=1eeb2f255e832171df8592078de921bc
+rhq.storage.password=1eeb2f255e832171df8592078de921bc
# Defines the number of tokens randomly assigned to a node on the ring. The more tokens,
# relative to other nodes, the larger the proportion of data that this node will store. You
diff --git a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index c189bfa..de13f5c 100644
--- a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++ b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -400,8 +400,8 @@ public class StorageInstaller {
PropertiesFileUpdate serverPropertiesUpdater = getServerProperties();
log.info("Updating rhq-server.properties...");
- serverPropertiesUpdater.update("rhq.cassandra.seeds",
- getSeedsProperty(hostname, jmxPort, nativeTransportPort));
+ serverPropertiesUpdater.update("rhq.storage.nodes", hostname);
+ serverPropertiesUpdater.update("rhq.storage.cql-port", nativeTransportPort + "");
}
boolean startNode = Boolean.parseBoolean(cmdLine.getOptionValue("start", "true"));
@@ -522,10 +522,6 @@ public class StorageInstaller {
return new PropertiesFileUpdate(file.getAbsolutePath());
}
- private String getSeedsProperty(String hostname, int jmxPort, int nativeTransportPort) {
- return hostname + "|" + jmxPort + "|" + nativeTransportPort;
- }
-
private String startNode(DeploymentOptions deploymentOptions) throws Exception {
org.apache.commons.exec.CommandLine cmdLine;
String errOutput;
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 261b6ba..44d73e8 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -17,7 +17,7 @@
<description>Database schema setup, upgrade and other utilities</description>
<properties>
- <db.schema.version>2.138</db.schema.version>
+ <db.schema.version>2.139</db.schema.version>
<rhq.ds.type-mapping>${rhq.test.ds.type-mapping}</rhq.ds.type-mapping>
<rhq.ds.server-name>${rhq.test.ds.server-name}</rhq.ds.server-name>
<rhq.ds.db-name>${rhq.test.ds.db-name}</rhq.ds.db-name>
@@ -274,11 +274,13 @@
if (project.getProperty('dbsetup-upgrade') || project.getProperty('dbreset') || project.getProperty('dbsetup')) {
if (project.getProperty('storage-schema')) {
self.log('PERFORMING STORAGE NODE SETUP TO LATEST SCHEMA')
- username = project.getProperty('rhq.cassandra.username') ?: "rhqadmin"
- password = project.getProperty('rhq.cassandra.password') ?: "rhqadmin"
- seeds = project.getProperty('rhq.cassandra.seeds') ?: "127.0.0.1|7299|9142"
+ username = project.getProperty('rhq.storage.username') ?: "rhqadmin"
+ password = project.getProperty('rhq.storage.password') ?: "rhqadmin"
- schemaManager = new SchemaManager(username, password, seeds)
+ nodes = project.getProperty('rhq.strorage.nodes') ?: "127.0.0.1"
+ cqlPort = project.getProperty('rhq.storage.cql-port') ?: "9142"
+
+ schemaManager = new SchemaManager(username, password, nodes.split(","), cqlPort)
if (project.getProperty('dbreset') == 'true') {
self.log('Dropping schema')
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml
index da9ff04..64a5d7f 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml
@@ -449,7 +449,6 @@
<table name="RHQ_STORAGE_NODE">
<column name="ID" default="sequence-only" initial="10001" primarykey="true" required="true" type="INTEGER" />
<column name="ADDRESS" required="true" size="255" type="VARCHAR2" />
- <column name="JMX_PORT" required="true" type="INTEGER" />
<column name="CQL_PORT" required="true" type="INTEGER" />
<column name="OPERATION_MODE" required="true" size="32" type="VARCHAR2" />
<column name="CTIME" required="true" type="LONG" />
@@ -464,5 +463,5 @@
<field ref="ADDRESS" />
</index>
</table>
-
+
</dbsetup>
\ No newline at end of file
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index bb2bb88..543f857 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -2220,6 +2220,14 @@
</schema-directSQL>
</schemaSpec>
+ <schemaSpec version="2.139">
+ <schema-directSQL>
+ <statement desc="Drop JMX port column from Storage Node table">
+ ALTER TABLE RHQ_STORAGE_NODE DROP COLUMN JMX_PORT
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
+
</dbupgrade>
</target>
</project>
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java
index 9df0a53..cdd314b 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/StorageNode.java
@@ -121,9 +121,6 @@ public class StorageNode implements Serializable {
@Column(name = "ADDRESS", nullable = false)
private String address;
- @Column(name = "JMX_PORT", nullable = false)
- private int jmxPort;
-
@Column(name = "CQL_PORT", nullable = false)
private int cqlPort;
@@ -178,11 +175,7 @@ public class StorageNode implements Serializable {
}
public int getJmxPort() {
- return jmxPort;
- }
-
- public void setJmxPort(int jmxPort) {
- this.jmxPort = jmxPort;
+ return 7299;
}
public int getCqlPort() {
@@ -308,15 +301,9 @@ public class StorageNode implements Serializable {
LEAVING
}
- public String getJMXConnectionURL() {
- // GWT doesn't support String.format()
- String[] split = JMX_CONNECTION_STRING.split("%s");
- return split[0] + this.address + split[1] + this.jmxPort + split[2];
- }
-
@Override
public String toString() {
- return "StorageNode[id=" + id + ", address=" + address + ", jmxPort=" + jmxPort + ", cqlPort=" + cqlPort
+ return "StorageNode[id=" + id + ", address=" + address + ", cqlPort=" + cqlPort
+ ", operationMode=" + operationMode + ", mtime=" + mtime + "]";
}
@@ -347,26 +334,13 @@ public class StorageNode implements Serializable {
final StorageNode other = (StorageNode) obj;
if (address == null) {
- if (other.address != null) {
+ if (other.getAddress() != null) {
return false;
}
- } else if (!address.equals(other.address)) {
+ } else if (!address.equals(other.getAddress())) {
return false;
}
return true;
}
-
- public void parseNodeInformation(String s) {
- String[] params = s.split("\\|");
- if (params.length != 3) {
- throw new IllegalArgumentException("Expected string of the form, hostname|jmxPort|nativeTransportPort: ["
- + s + "]");
- }
-
- this.setAddress(params[0]);
- this.setJmxPort(Integer.parseInt(params[1]));
- this.setCqlPort(Integer.parseInt(params[2]));
- }
-
}
diff --git a/modules/core/domain/src/test/java/org/rhq/core/domain/cloud/StorageNodeTest.java b/modules/core/domain/src/test/java/org/rhq/core/domain/cloud/StorageNodeTest.java
index ce4dbbd..1395884 100644
--- a/modules/core/domain/src/test/java/org/rhq/core/domain/cloud/StorageNodeTest.java
+++ b/modules/core/domain/src/test/java/org/rhq/core/domain/cloud/StorageNodeTest.java
@@ -22,7 +22,6 @@
*/
package org.rhq.core.domain.cloud;
-import org.testng.Assert;
import org.testng.annotations.Test;
import org.rhq.core.domain.cloud.StorageNode.OperationMode;
@@ -33,79 +32,48 @@ public class StorageNodeTest {
StorageNode localhost1 = new StorageNode();
assert localhost1 != null;
assert !localhost1.equals(null);
-
+
StorageNode localhost2 = new StorageNode();
assert localhost2 != null;
assert localhost1.equals(localhost2);
assert localhost2.equals(localhost1);
-
+
localhost1.setAddress("127.0.0.1");
assert !localhost1.equals(localhost2);
assert !localhost2.equals(localhost1);
-
+
localhost2.setAddress("127.0.0.1");
assert localhost1.equals(localhost2);
assert localhost2.equals(localhost1);
-
+
StorageNode localhost3 = new StorageNode(42);
localhost3.setAddress("sn.com");
assert !localhost3.equals(null);
assert !localhost3.equals(localhost1);
assert localhost3.hashCode() != localhost1.hashCode();
assert localhost2.hashCode() == localhost1.hashCode();
-
+
localhost3.setAddress("127.0.0.1");
assert localhost3.equals(localhost1);
assert localhost3.hashCode() == localhost1.hashCode();
}
- public void testParseNodeInformation1() {
+ public void testNodeInformation1() {
StorageNode localhost1 = new StorageNode();
- localhost1.parseNodeInformation("127.0.0.1|1234|4321");
+ localhost1.setAddress("127.0.0.1");
+ localhost1.setCqlPort(4321);
assert "127.0.0.1".equals(localhost1.getAddress());
- assert localhost1.getJmxPort() == 1234;
assert localhost1.getCqlPort() == 4321;
- assert "service:jmx:rmi:///jndi/rmi://127.0.0.1:1234/jmxrmi".equals(localhost1.getJMXConnectionURL());
-
+
localhost1.setOperationMode(OperationMode.INSTALLED);
assert localhost1.getOperationMode() == OperationMode.INSTALLED;
assert localhost1.getOperationMode().getMessage() != null;
assert localhost1.getOperationMode().getMessage() != null;
localhost1.setMtime(42);
assert localhost1.getMtime() == 42;
-
+
StorageNode localhost2 = new StorageNode();
- localhost2.parseNodeInformation("127.0.0.1|1235|5321");
+ localhost2.setAddress("127.0.0.1");
assert localhost1.equals(localhost2);
- assert !localhost1.getJMXConnectionURL().equals(localhost2.getJMXConnectionURL());
- }
-
- public void testParseNodeInformation2() {
- StorageNode localhost1 = new StorageNode();
- try {
- localhost1.parseNodeInformation("127.0.0.1|1234|4321|foo");
- Assert.fail("The exception (IllegalArgumentException) should be thrown!");
- } catch (IllegalArgumentException e) {
- }
- try {
- localhost1.parseNodeInformation("127.0.0.1|1234");
- Assert.fail("The exception (IllegalArgumentException) should be thrown!");
- } catch (IllegalArgumentException e) {
- }
- try {
- localhost1.parseNodeInformation("127.0.0.1|aaaa|4321");
- Assert.fail("The exception (NumberFormatException) should be thrown!");
- } catch (NumberFormatException e) {
- }
- try {
- localhost1.parseNodeInformation("127.0.0.1|1234|bbbb");
- Assert.fail("The exception (NumberFormatException) should be thrown!");
- } catch (NumberFormatException e) {
- }
- try {
- localhost1.parseNodeInformation(null);
- Assert.fail("The exception (NullPointerException) should be thrown!");
- } catch (NullPointerException e) {
- }
}
}
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index 2c8bcbe..566a0c9 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -672,23 +672,29 @@ rhq.sync.endpoint-address=false
# Cassandra cluster configuration settings
#############################################
# The username RHQ will use to authenticate against Cassandra.
-rhq.cassandra.username=${rhq.cassandra.username}
+rhq.storage.username=${rhq.storage.username}
# The password RHQ will use to authenticate against Cassandra.
-rhq.cassandra.password=${rhq.cassandra.password}
+rhq.storage.password=${rhq.storage.password}
-# A comma-delimited list of seed nodes. Each Cassandra node uses this list as
+# A comma-delimited list of storage nodes. Each Cassandra node uses this list as
# contact points to find other nodes in the cluster and learn the ring
# topology. The RHQ server(s) use this list to connect to the cluster;
# therefore, this property MUST BE SET in order for RHQ to talk to Cassandra.
-# Each entry in the list consists of three fields that are pipe-delimited. The
-# of an entry is as follows,
+# The of an entry is as follows,
#
-# hostname|jmxPort|nativeTransportPort|
+# hostname1,hostname2
#
# Note that this is actually an installer setting. Changing the value after
# installation will have no effect.
-rhq.cassandra.seeds=
+rhq.storage.nodes=
+
+# The list of ports used by storages nodes to communiticate with each other
+# and used by the RHQ server(s) to communicate with the cluster.
+# Both properties are required.
+#
+rhq.storage.cql-port=${rhq.cassandra.native-transport-port}
+rhq.storage.gossip-port=${rhq.cassandra.native-transport-port}
# If enabled data sent to and from storage nodes will be compressed using
# snappy (https://code.google.com/p/snappy) compression. Note that this is an
diff --git a/modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java b/modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java
index 6ee0e57..80e1129 100644
--- a/modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java
+++ b/modules/enterprise/server/data-migration/src/main/java/org/rhq/server/metrics/migrator/DataMigratorRunner.java
@@ -349,6 +349,7 @@ public class DataMigratorRunner {
serverProperties.load(stream);
stream.close();
+ //SQL options
String dbType = serverProperties.getProperty("rhq.server.database.type-mapping");
DatabaseType databaseType = DatabaseType.Postgres;
if (dbType != null && dbType.toLowerCase().contains("oracle")) {
@@ -361,28 +362,20 @@ public class DataMigratorRunner {
configuration.put(sqlPasswordOption, PicketBoxObfuscator.decode(dbPasswordProperty));
configuration.put(sqlConnectionUrlOption, serverProperties.getProperty("rhq.server.database.connection-url"));
- configuration.put(cassandraUserOption, serverProperties.getProperty("rhq.cassandra.username"));
- String cassandraPasswordProperty = serverProperties.getProperty("rhq.cassandra.password");
+ //Storage Node options
+ configuration.put(cassandraUserOption, serverProperties.getProperty("rhq.storage.username"));
+ String cassandraPasswordProperty = serverProperties.getProperty("rhq.storage.password");
configuration.put(cassandraPasswordOption, PicketBoxObfuscator.decode(cassandraPasswordProperty));
- if (serverProperties.getProperty("rhq.cassandra.seeds") != null
- && !serverProperties.getProperty("rhq.cassandra.seeds").trim().isEmpty()) {
-
- String[] unparsedSeeds =serverProperties.getProperty("rhq.cassandra.seeds").split(",");
- String[] seedHosts = new String[unparsedSeeds.length];
- Integer cassandraPort = null;
- for (int index = 0; index < unparsedSeeds.length; index++) {
- String[] params = unparsedSeeds[index].split("\\|");
- if (params.length != 3) {
- throw new IllegalArgumentException(
- "Expected string of the form, hostname|jmxPort|nativeTransportPort: [" + unparsedSeeds[index] + "]");
- }
-
- seedHosts[index] = params[0];
- cassandraPort = tryParseInteger(params[2], DEFAULT_CASSANDRA_PORT);
- }
+ if (serverProperties.getProperty("rhq.storage.nodes") != null
+ && !serverProperties.getProperty("rhq.storage.nodes").trim().isEmpty()) {
+ String[] storageNodes = serverProperties.getProperty("rhq.storage.nodes").split(",");
+ configuration.put(cassandraHostsOption, storageNodes);
+ }
- configuration.put(cassandraHostsOption, seedHosts);
+ if (serverProperties.getProperty("rhq.storage.cql-port") != null
+ && !serverProperties.getProperty("rhq.storage.cql-port").trim().isEmpty()) {
+ Integer cassandraPort = Integer.parseInt(serverProperties.getProperty("rhq.storage.cql-port"));
configuration.put(cassandraPortOption, cassandraPort);
}
}
diff --git a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index e103356..03a34cb 100644
--- a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++ b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -1158,12 +1158,14 @@ public class InstallerServiceImpl implements InstallerService {
}
private List<StorageNode> parseNodeInformation(HashMap<String, String> serverProps) {
- String[] nodes = serverProps.get("rhq.cassandra.seeds").split(",");
+ String[] nodes = serverProps.get("rhq.storage.nodes").split(",");
+ String cqlPort = serverProps.get("rhq.storage.cql-port");
List<StorageNode> parsedNodes = new ArrayList<StorageNode>();
for (String node : nodes) {
StorageNode storageNode = new StorageNode();
- storageNode.parseNodeInformation(node);
+ storageNode.setAddress(node);
+ storageNode.setCqlPort(Integer.parseInt(cqlPort));
parsedNodes.add(storageNode);
}
@@ -1171,8 +1173,8 @@ public class InstallerServiceImpl implements InstallerService {
}
private SchemaManager createStorageNodeSchemaManager(HashMap<String, String> serverProps) {
- String username = serverProps.get("rhq.cassandra.username");
- String password = serverProps.get("rhq.cassandra.password");
+ String username = serverProps.get("rhq.storage.username");
+ String password = serverProps.get("rhq.storage.password");
List<StorageNode> storageNodes = this.parseNodeInformation(serverProps);
String[] nodes = new String[storageNodes.size()];
diff --git a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
index cc947c3..8900d8a 100644
--- a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
+++ b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/ServerInstallUtil.java
@@ -902,7 +902,7 @@ public class ServerInstallUtil {
/**
* Persists the storage nodes to the database only if no storage node entities already exist. This method is used
- * to persist storage nodes created from the rhq.cassandra.seeds server configuration property. The only time those
+ * to persist storage nodes created from the rhq.storage.nodes server configuration property. The only time those
* seed nodes should be created is during an initial server installation. After the initial installation storage
* nodes should be created using <code>rhqctl install</code>. This ensures that any necessary cluster maintenance
* tasks will be performed.
@@ -939,23 +939,21 @@ public class ServerInstallUtil {
connection.setAutoCommit(false);
try {
- LOG.info("Persisting to database new storage nodes for values specified in server configuration " +
- "property [rhq.cassandra.seeds]");
+ LOG.info("Persisting to database new storage nodes for values specified in server configuration property [rhq.storage.nodes]");
insertStatement = connection.prepareStatement(
- "INSERT INTO rhq_storage_node (id, address, jmx_port, cql_port, operation_mode, ctime, mtime) " +
- "VALUES (?, ?, ?, ?, ?, ?, ?)"
+ "INSERT INTO rhq_storage_node (id, address, cql_port, operation_mode, ctime, mtime) " +
+ "VALUES (?, ?, ?, ?, ?, ?)"
);
int id = 1001;
for (StorageNode storageNode : storageNodes) {
insertStatement.setInt(1, id);
insertStatement.setString(2, storageNode.getAddress());
- insertStatement.setInt(3, storageNode.getJmxPort());
- insertStatement.setInt(4, storageNode.getCqlPort());
- insertStatement.setString(5, StorageNode.OperationMode.INSTALLED.toString());
+ insertStatement.setInt(3, storageNode.getCqlPort());
+ insertStatement.setString(4, StorageNode.OperationMode.INSTALLED.toString());
+ insertStatement.setLong(5, System.currentTimeMillis());
insertStatement.setLong(6, System.currentTimeMillis());
- insertStatement.setLong(7, System.currentTimeMillis());
insertStatement.executeUpdate();
id += 1;
@@ -964,13 +962,12 @@ public class ServerInstallUtil {
connection.commit();
} catch (SQLException e) {
LOG.error("Failed to persist to database the storage nodes specified by server configuration " +
- "property [rhq.cassandra.seeds]. Transaction will be rolled back.", e);
+ "property [rhq.storage.nodes]. Transaction will be rolled back.", e);
connection.rollback();
throw e;
}
} else {
- LOG.info("Storage nodes already exist in database. Server configuration property " +
- "[rhq.cassandra.seeds] will be ignored.");
+ LOG.info("Storage nodes already exist in database. Server configuration property [rhq.storage.nodes] will be ignored.");
}
} finally {
diff --git a/modules/enterprise/server/itests-2/pom.xml b/modules/enterprise/server/itests-2/pom.xml
index 63eb166..0dacb1a 100644
--- a/modules/enterprise/server/itests-2/pom.xml
+++ b/modules/enterprise/server/itests-2/pom.xml
@@ -33,9 +33,10 @@
<skip.oracle>true</skip.oracle>
<!-- cassandra connection properties -->
- <rhq.cassandra.username>rhqadmin</rhq.cassandra.username>
- <rhq.cassandra.password>rhqadmin</rhq.cassandra.password>
- <rhq.cassandra.seeds>127.0.0.1|9160|9042,127.0.0.2|9160|9042</rhq.cassandra.seeds>
+ <rhq.storage.username>rhqadmin</rhq.storage.username>
+ <rhq.storage.password>rhqadmin</rhq.storage.password>
+ <rhq.storage.nodes>127.0.0.1,127.0.0.2</rhq.storage.nodes>
+ <rhq.storage.cql-port>9042</rhq.storage.cql-port>
</properties>
<dependencies>
diff --git a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBeanTest.java b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBeanTest.java
index 78c0cff..debe690 100644
--- a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBeanTest.java
+++ b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBeanTest.java
@@ -25,12 +25,7 @@
package org.rhq.enterprise.server.cloud;
-import static org.rhq.enterprise.server.cloud.StorageNodeManagerBean.STORAGE_NODE_GROUP_NAME;
-
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
import java.util.UUID;
@@ -38,19 +33,16 @@ import javax.ejb.EJB;
import javax.persistence.Query;
import javax.transaction.Transaction;
-import org.testng.Assert;
import org.testng.annotations.Test;
import org.rhq.core.domain.cloud.StorageNode;
import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
import org.rhq.core.domain.configuration.definition.PropertySimpleType;
-import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.criteria.StorageNodeCriteria;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
-import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
@@ -96,7 +88,6 @@ public class StorageNodeManagerBeanTest extends AbstractEJB3Test {
StorageNode node = new StorageNode();
node.setAddress(address);
node.setOperationMode(StorageNode.OperationMode.NORMAL);
- node.setJmxPort(7299 + i);
node.setCqlPort(9142 + i);
if (i == 0) {
firstOne = node;
diff --git a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBeanPreparation.java b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBeanPreparation.java
index cf9d84c..258cbb8 100644
--- a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBeanPreparation.java
+++ b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/StrippedDownStartupBeanPreparation.java
@@ -47,9 +47,9 @@ import org.rhq.enterprise.server.cloud.instance.ServerManagerLocal;
* This startup singleton EJB is here to work around bug AS7-5530 and to
* schedule the real StartupBean's work in a delayed fashion (this is to allow
* AS7 to complete its deployment work before we do our work).
- *
+ *
* See https://issues.jboss.org/browse/AS7-5530
- *
+ *
* This version is a replacement for the original code (identical) code that uses the StrippedDownStartupBean instead
* of the fullblown original.
*/
@@ -100,10 +100,12 @@ public class StrippedDownStartupBeanPreparation {
}
private void createStorageNodes() {
- String[] seedsInfo = System.getProperty("rhq.cassandra.seeds").split(",");
- for (String seedInfo : seedsInfo) {
+ String[] nodes = System.getProperty("rhq.storage.nodes").split(",");
+ String cqlPort = System.getProperty("rhq.storage.cql-port");
+ for (String node : nodes) {
StorageNode storageNode = new StorageNode();
- storageNode.parseNodeInformation(seedInfo);
+ storageNode.setAddress(node);
+ storageNode.setCqlPort(Integer.parseInt(cqlPort));
storageNode.setOperationMode(StorageNode.OperationMode.NORMAL);
entityManager.persist(storageNode);
}
@@ -120,9 +122,10 @@ public class StrippedDownStartupBeanPreparation {
// caused some arquillian deployment exception.
//
// jsanda
- System.setProperty("rhq.cassandra.username", props.getProperty("rhq.cassandra.username"));
- System.setProperty("rhq.cassandra.password", props.getProperty("rhq.cassandra.password"));
- System.setProperty("rhq.cassandra.seeds", props.getProperty("rhq.cassandra.seeds"));
+ System.setProperty("rhq.storage.username", props.getProperty("rhq.storage.username"));
+ System.setProperty("rhq.storage.password", props.getProperty("rhq.storage.password"));
+ System.setProperty("rhq.storage.nodes", props.getProperty("rhq.storage.nodes"));
+ System.setProperty("rhq.storage.cql-port", props.getProperty("rhq.storage.cql-port"));
} catch (IOException e) {
throw new RuntimeException(("Failed to load cassandra-test.properties"));
}
diff --git a/modules/enterprise/server/itests-2/src/test/resources/cassandra-test.properties b/modules/enterprise/server/itests-2/src/test/resources/cassandra-test.properties
index 9c6c381..d4185d0 100644
--- a/modules/enterprise/server/itests-2/src/test/resources/cassandra-test.properties
+++ b/modules/enterprise/server/itests-2/src/test/resources/cassandra-test.properties
@@ -1,3 +1,4 @@
-rhq.cassandra.username=${rhq.cassandra.username}
-rhq.cassandra.password =${rhq.cassandra.password}
-rhq.cassandra.seeds=${rhq.cassandra.seeds}
\ No newline at end of file
+rhq.storage.username=${rhq.storage.username}
+rhq.storage.password =${rhq.storage.password}
+rhq.storage.nodes=${rhq.storage.nodes}
+rhq.storage.cql-port=${rhq.storage.cql-port}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
index a7d9945..b30e50a 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
@@ -152,7 +152,7 @@ public class StorageNodeManagerBean implements StorageNodeManagerLocal, StorageN
@EJB
private StorageNodeManagerLocal storageNodeManger;
-
+
@EJB
private StorageClientManagerBean storageClientManager;
@@ -238,7 +238,6 @@ public class StorageNodeManagerBean implements StorageNodeManagerLocal, StorageN
StorageNode storageNode = new StorageNode();
storageNode.setAddress(pluginConfig.getSimpleValue(RHQ_STORAGE_ADDRESS_PROPERTY));
storageNode.setCqlPort(Integer.parseInt(pluginConfig.getSimpleValue(RHQ_STORAGE_CQL_PORT_PROPERTY)));
- storageNode.setJmxPort(Integer.parseInt(pluginConfig.getSimpleValue(RHQ_STORAGE_JMX_PORT_PROPERTY)));
storageNode.setResource(resource);
storageNode.setOperationMode(OperationMode.INSTALLED);
@@ -719,11 +718,14 @@ public class StorageNodeManagerBean implements StorageNodeManagerLocal, StorageN
Resource storageNodeResource = storageNode.getResource();
Configuration storageNodeConfiguration = configurationManager.getResourceConfiguration(subject,
storageNodeResource.getId());
+ Configuration storageNodePluginConfiguration = configurationManager.getPluginConfiguration(subject,
+ storageNodeResource.getId());
configuration.setHeapSize(storageNodeConfiguration.getSimpleValue("maxHeapSize"));
configuration.setHeapNewSize(storageNodeConfiguration.getSimpleValue("heapNewSize"));
configuration.setThreadStackSize(storageNodeConfiguration.getSimpleValue("threadStackSize"));
- configuration.setJmxPort(storageNode.getJmxPort());
+ configuration.setJmxPort(Integer.parseInt(storageNodePluginConfiguration
+ .getSimpleValue(RHQ_STORAGE_JMX_PORT_PROPERTY)));
}
return configuration;
@@ -763,12 +765,7 @@ public class StorageNodeManagerBean implements StorageNodeManagerLocal, StorageN
parameters);
if (result) {
- //2. Update the JMX port
- //this is a fast operation compared to the restart
- storageNode.setJmxPort(storageNodeConfiguration.getJmxPort());
- entityManager.merge(storageNode);
-
- //3. Update the plugin configuration to talk with the new server
+ //2. Update the plugin configuration to talk with the new server
Configuration storageNodePluginConfig = configurationManager.getPluginConfiguration(subject,
storageNodeResource.getId());
@@ -855,7 +852,7 @@ public class StorageNodeManagerBean implements StorageNodeManagerLocal, StorageN
return result;
}
-
+
private boolean runOperationAndWaitForResult(Subject subject, Resource storageNodeResource, String operationToRun,
Configuration parameters) {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 7f8b0fd..4ec3583 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -65,8 +65,8 @@ public class StorageClientManagerBean {
private final Log log = LogFactory.getLog(StorageClientManagerBean.class);
- private static final String USERNAME_PROP = "rhq.cassandra.username";
- private static final String PASSWORD_PROP = "rhq.cassandra.password";
+ private static final String USERNAME_PROP = "rhq.storage.username";
+ private static final String PASSWORD_PROP = "rhq.storage.password";
private static final String RHQ_KEYSPACE = "rhq";
@EJB
diff --git a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
index 9245baf..d9f63de 100644
--- a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
+++ b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
@@ -154,7 +154,7 @@ public class Upgrade extends AbstractInstall {
// if the agent already exists in the default location, it may be there from a prior install.
if (isStorageInstalled() || isServerInstalled()) {
log.warn("RHQ is already installed so upgrade can not be performed.");
- return;
+ //return;
}
// Stop the agent, if running.
@@ -432,6 +432,42 @@ public class Upgrade extends AbstractInstall {
oldServerProps.setProperty("rhq.server.socket.binding.port.https", httpsPort);
}
+ //Migrate storage node properties
+ String storageUsername = oldServerProps.getProperty("rhq.cassandra.username");
+ if (storageUsername != null) {
+ oldServerProps.remove("rhq.cassandra.username");
+ oldServerProps.setProperty("rhq.storage.username", storageUsername);
+ }
+
+ String storagePassword = oldServerProps.getProperty("rhq.cassandra.password");
+ if (storagePassword != null) {
+ oldServerProps.remove("rhq.cassandra.password");
+ oldServerProps.setProperty("rhq.storage.password", storagePassword);
+ }
+
+ String storageSeeds = oldServerProps.getProperty("rhq.cassandra.seeds");
+ if (storageSeeds != null) {
+ StringBuffer storageNodes = new StringBuffer();
+ String cqlPort = "";
+
+ String[] unparsedNodes = storageSeeds.split(",");
+ for (int index = 0; index < unparsedNodes.length; index++) {
+ String[] params = unparsedNodes[index].split("\\|");
+ if (params.length == 3) {
+ storageNodes.append(params[0]);
+ if (index < unparsedNodes.length - 1) {
+ storageNodes.append(",");
+ }
+
+ cqlPort = params[2];
+ }
+ }
+
+ oldServerProps.remove("rhq.cassandra.seeds");
+ oldServerProps.setProperty("rhq.storage.nodes", storageNodes.toString());
+ oldServerProps.setProperty("rhq.storage.cql-port", cqlPort);
+ }
+
// copy the old key/truststore files from the old location to the new server configuration directory
copyReferredFile(commandLine, oldServerProps, "rhq.server.tomcat.security.keystore.file");
copyReferredFile(commandLine, oldServerProps, "rhq.server.tomcat.security.truststore.file");
diff --git a/modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java b/modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java
index 7f07be9..a02c63a 100644
--- a/modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java
+++ b/modules/plugins/rhq-storage/src/test/java/org/rhq/plugins/storage/StorageNodeComponentITest.java
@@ -147,11 +147,12 @@ public class StorageNodeComponentITest {
assertEquals(results.getExitCode(), (Integer) 0, "Cassandra failed to start: " + results.getCapturedOutput());
StorageNode storageNode = new StorageNode();
- storageNode.parseNodeInformation("127.0.0.1|7399|9142");
+ storageNode.setAddress("127.0.0.1");
+ int jmxPort = 7399;
+ storageNode.setCqlPort(9142);
ClusterInitService clusterInitService = new ClusterInitService();
- clusterInitService.waitForClusterToStart(new String[] { storageNode.getAddress() },
- new int[] { storageNode.getJmxPort() });
+ clusterInitService.waitForClusterToStart(new String[] { storageNode.getAddress() }, new int[] { jmxPort });
SchemaManager schemaManager = new SchemaManager("rhqadmin", "1eeb2f255e832171df8592078de921bc",
new String[] { storageNode.getAddress() }, storageNode.getCqlPort());
10 years, 8 months
[rhq] 2 commits - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java | 1
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java | 161 +---------
2 files changed, 21 insertions(+), 141 deletions(-)
New commits:
commit 87f33d5491f2e8be0701ae1efb29f2b19c9c9f82
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Aug 29 14:32:32 2013 -0700
Fix metrics view bug when collapsing rows and refreshing the already open graphs. They stay open but graphs don't get repainted.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
index 32436b0..ec0496d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
@@ -159,7 +159,6 @@ public class MetricsResourceView extends AbstractD3GraphListView {
@Override
public void run() {
availabilityGraph.drawJsniChart();
- metricsTableView.refreshOpenGridRows();
}
}.schedule(150);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
index e29e63a..9fc2949 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
@@ -142,7 +142,6 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
*/
public void refreshData() {
Log.debug("MetricsView.redrawGraphs.");
-
new Timer() {
@Override
@@ -153,19 +152,6 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
}
- public void refreshOpenGridRows(){
- ListGridRecord[] metricsRecords = metricsTableListGrid.getRecords();
- for (int i = 0; i < metricsRecords.length; i++) {
- ListGridRecord metricsRecord = metricsRecords[i];
- if(null != metricsRecord){
- int metricDefinitionId = metricsRecord
- .getAttributeAsInt(MetricsViewDataSource.FIELD_METRIC_DEF_ID);
- if(expandedRows.contains(metricDefinitionId)){
- metricsTableListGrid.expandRecord(metricsRecord);
- }
- }
- }
- }
public class MetricsTableListGrid extends ListGrid {
@@ -196,7 +182,14 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
public void onRecordCollapse(RecordCollapseEvent recordCollapseEvent) {
metricsTableView.expandedRows.remove(recordCollapseEvent.getRecord().getAttributeAsInt(
MetricsViewDataSource.FIELD_METRIC_DEF_ID));
- refreshData();
+ refresh();
+ new Timer() {
+
+ @Override
+ public void run() {
+ BrowserUtility.graphSparkLines();
+ }
+ }.schedule(150);
}
});
addSortChangedHandler(new SortChangedHandler() {
commit 178917ff105a5fe69853dc049c29abb4424abf7a
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Aug 29 14:13:52 2013 -0700
Remove the live value dialog from metrics view.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
index 525ec42..e29e63a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
@@ -20,9 +20,6 @@
package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.table;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -31,12 +28,8 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.ExpansionMode;
-import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
-import com.smartgwt.client.widgets.Window;
-import com.smartgwt.client.widgets.events.CloseClickEvent;
-import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -52,12 +45,9 @@ import com.smartgwt.client.widgets.grid.events.SortChangedHandler;
import com.smartgwt.client.widgets.grid.events.SortEvent;
import com.smartgwt.client.widgets.layout.VLayout;
-import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDefinition;
-import org.rhq.core.domain.measurement.MeasurementUnits;
import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.UserSessionManager;
import org.rhq.enterprise.gui.coregui.client.components.table.Table;
import org.rhq.enterprise.gui.coregui.client.components.table.TableAction;
@@ -69,7 +59,6 @@ import org.rhq.enterprise.gui.coregui.client.inventory.common.graph.graphtype.St
import org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.monitoring.MetricD3Graph;
import org.rhq.enterprise.gui.coregui.client.util.BrowserUtility;
import org.rhq.enterprise.gui.coregui.client.util.Log;
-import org.rhq.enterprise.gui.coregui.client.util.MeasurementConverterClient;
import org.rhq.enterprise.gui.coregui.client.util.preferences.MeasurementUserPreferences;
/**
@@ -117,7 +106,19 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
setListGridFields(fields.toArray(new ListGridField[0]));
if(!rendered){
- addTableAction(MSG.view_measureTable_getLive(), new ShowLiveDataTableAction(this));
+ addTableAction(MSG.view_measureTable_getLive(), new TableAction() {
+ @Override
+ public boolean isEnabled(ListGridRecord[] selection) {
+ //return selection != null && selection.length != 0;
+ return true;
+ }
+
+ @Override
+ public void executeAction(ListGridRecord[] selection, Object actionValue) {
+ refresh();
+ }
+ });
+
addExtraWidget(addToDashboardComponent, false);
addToDashboardComponent.disableAddToDashboardButton();
metricsTableListGrid.addSelectionChangedHandler(new SelectionChangedHandler() {
@@ -134,119 +135,6 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
}
}
- private static class ShowLiveDataTableAction implements TableAction {
- private MetricsTableView metricsTableView;
-
- public ShowLiveDataTableAction(MetricsTableView metricsTableView) {
- this.metricsTableView = metricsTableView;
- }
-
- @Override
- public boolean isEnabled(ListGridRecord[] selection) {
- return selection != null && selection.length > 0;
- }
-
- @Override
- public void executeAction(ListGridRecord[] selection, Object actionValue) {
- if (selection == null || selection.length == 0) {
- return;
- }
- // keyed on metric name - string[0] is the metric label, [1] is the units
- final HashMap<String, String[]> scheduleNamesAndUnits = new HashMap<String, String[]>();
- int[] definitionIds = new int[selection.length];
- int i = 0;
- for (ListGridRecord record : selection) {
- Integer defId = record.getAttributeAsInt(MetricsViewDataSource.FIELD_METRIC_DEF_ID);
- definitionIds[i++] = defId;
-
- String name = record.getAttribute(MetricsViewDataSource.FIELD_METRIC_NAME);
- String label = record.getAttribute(MetricsViewDataSource.FIELD_METRIC_LABEL);
- String units = record.getAttribute(MetricsViewDataSource.FIELD_METRIC_UNITS);
- if (units == null || units.length() < 1) {
- units = MeasurementUnits.NONE.name();
- }
-
- scheduleNamesAndUnits.put(name, new String[] { label, units });
- }
-
- // actually go out and ask the agents for the data
- GWTServiceLookup.getMeasurementDataService(60000).findLiveData(metricsTableView.resource.getId(),
- definitionIds, new AsyncCallback<Set<MeasurementData>>() {
- @Override
- public void onSuccess(Set<MeasurementData> result) {
- if (result == null) {
- result = new HashSet<MeasurementData>(0);
- }
- ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>(result.size());
- for (MeasurementData data : result) {
- String[] nameAndUnits = scheduleNamesAndUnits.get(data.getName());
- if (nameAndUnits != null) {
- double doubleValue;
- if (data.getValue() instanceof Number) {
- doubleValue = ((Number) data.getValue()).doubleValue();
- } else {
- doubleValue = Double.parseDouble(data.getValue().toString());
- }
- String value = MeasurementConverterClient.formatToSignificantPrecision(
- new double[] { doubleValue }, MeasurementUnits.valueOf(nameAndUnits[1]), true)[0];
-
- ListGridRecord record = new ListGridRecord();
- record.setAttribute("name", nameAndUnits[0]);
- record.setAttribute("value", value);
- records.add(record);
- }
- }
- Collections.sort(records, new Comparator<ListGridRecord>() {
- public int compare(ListGridRecord o1, ListGridRecord o2) {
- return o1.getAttribute("name").compareTo(o2.getAttribute("name"));
- }
- });
- showLiveData(records);
- }
-
- @Override
- public void onFailure(Throwable caught) {
- CoreGUI.getErrorHandler().handleError(MSG.view_measureTable_getLive_failure(), caught);
- }
- });
- }
-
- private void showLiveData(ArrayList<ListGridRecord> records) {
- final Window liveDataWindow = new Window();
- liveDataWindow.setTitle(MSG.view_measureTable_live_title());
- liveDataWindow.setShowModalMask(true);
- liveDataWindow.setShowMinimizeButton(false);
- liveDataWindow.setShowMaximizeButton(true);
- liveDataWindow.setShowCloseButton(true);
- liveDataWindow.setShowResizer(true);
- liveDataWindow.setCanDragResize(true);
- liveDataWindow.setDismissOnEscape(true);
- liveDataWindow.setIsModal(true);
- liveDataWindow.setWidth(700);
- liveDataWindow.setHeight(425);
- liveDataWindow.setAutoCenter(true);
- liveDataWindow.centerInPage();
- liveDataWindow.addCloseClickHandler(new CloseClickHandler() {
- @Override
- public void onCloseClick(CloseClickEvent event) {
- liveDataWindow.destroy();
- metricsTableView.refreshTableInfo();
- }
- });
-
- ListGrid liveDataGrid = new ListGrid();
- liveDataGrid.setShowAllRecords(true);
- liveDataGrid.setData(records.toArray(new ListGridRecord[records.size()]));
- liveDataGrid.setSelectionType(SelectionStyle.NONE);
- ListGridField name = new ListGridField("name", MSG.common_title_metric());
- ListGridField value = new ListGridField("value", MSG.common_title_value());
- liveDataGrid.setFields(name, value);
-
- liveDataWindow.addItem(liveDataGrid);
- liveDataWindow.show();
- }
-
- }
@Override
/**
10 years, 8 months
[rhq] modules/enterprise
by John Sanda
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java | 41 ++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MetricsManagerBean.java | 132 ----------
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MetricsManagerLocal.java | 69 -----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJob.java | 11
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java | 7
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java | 14 -
modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java | 44 +--
modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageResultSetFuture.java | 42 +--
modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java | 13
9 files changed, 103 insertions(+), 270 deletions(-)
New commits:
commit d98c76cebf2e8512a2653384844819befeb8db72
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Aug 29 15:52:47 2013 -0400
[BZ 1002210] clean up exceptions in server.log
There were some methods in MeasurementDataManagerBean with default transaction
support, but they should be NOT_SUPPORTED since they read/write to and from
Cassandra. This will help reduce stacktraces because when exceptions bubble up
from those methods they will no longer get wrapped in EJBExceptions.
When an error occurs while inserting raw data, we are no longer logging the
full exception. There is a better than likely change that if an exception
occurs for one write, it will ocurr for several. Logging each of the exceptions
resulted in a lot of noise in the logs. Now only the error message is logged.
The full exception will be logged with DEBUG logging.
Lastly, I altogether removed MetricsManagerBean. It was left over cruft from
some of the early integration of C* code.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
index 3c1232d..c94d61b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
@@ -99,6 +99,8 @@ import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
import org.rhq.server.metrics.MetricsServer;
import org.rhq.server.metrics.RawDataInsertedCallback;
+import org.rhq.server.metrics.domain.AggregateNumericMetric;
+import org.rhq.server.metrics.domain.RawNumericMetric;
/**
* A manager for {@link MeasurementData}s.
@@ -155,10 +157,7 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
private MeasurementDefinitionManagerLocal measurementDefinitionManager;
@EJB
- private MetricsManagerLocal metricsManager;
-
- @EJB
- private StorageClientManagerBean storageClientManagerBean;
+ private StorageClientManagerBean storageClientManager;
@EJB
private MeasurementScheduleManagerLocal measurementScheduleManager;
@@ -228,7 +227,7 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
return;
}
- MetricsServer metricsServer = storageClientManagerBean.getMetricsServer();
+ MetricsServer metricsServer = storageClientManager.getMetricsServer();
metricsServer.addNumericData(data, new RawDataInsertedCallback() {
private ReentrantLock lock = new ReentrantLock();
@@ -579,7 +578,9 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
@Nullable
public MeasurementDataNumeric getCurrentNumericForSchedule(int scheduleId) {
- return metricsManager.findLatestValueForResource(scheduleId);
+ MetricsServer metricsServer = storageClientManager.getMetricsServer();
+ RawNumericMetric metric = metricsServer.findLatestValueForResource(scheduleId);
+ return new MeasurementDataNumeric(metric.getTimestamp(), scheduleId, metric.getValue());
}
@Asynchronous
@@ -595,6 +596,7 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
log.debug(callingMethod + ": " + stats.toString());
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public MeasurementAggregate getAggregate(Subject subject, int scheduleId, long startTime, long endTime) {
MeasurementSchedule schedule = entityManager.find(MeasurementSchedule.class, scheduleId);
if (schedule == null) {
@@ -614,9 +616,13 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
throw new IllegalArgumentException("Start date " + startTime + " is not before " + endTime);
}
- return metricsManager.getSummaryAggregate(scheduleId, startTime, endTime);
+ MetricsServer metricsServer = storageClientManager.getMetricsServer();
+ AggregateNumericMetric summary = metricsServer.getSummaryAggregate(scheduleId, startTime, endTime);
+
+ return new MeasurementAggregate(summary.getMin(), summary.getAvg(), summary.getMax());
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public MeasurementAggregate getAggregate(Subject subject, int groupId, int definitionId, long startTime,
long endTime) {
@@ -642,7 +648,10 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
PageList<MeasurementSchedule> schedules = measurementScheduleManager.findSchedulesByCriteria(subject,
criteria);
- return metricsManager.getSummaryAggregate(map(schedules), startTime, endTime);
+ MetricsServer metricsServer = storageClientManager.getMetricsServer();
+ AggregateNumericMetric summary = metricsServer.getSummaryAggregate(map(schedules), startTime, endTime);
+
+ return new MeasurementAggregate(summary.getMin(), summary.getAvg(), summary.getMax());
}
/**
@@ -697,6 +706,7 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
return result;
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public List<List<MeasurementDataNumericHighLowComposite>> findDataForCompatibleGroup(Subject subject, int groupId,
int definitionId, long beginTime, long endTime, int numPoints) {
@@ -705,8 +715,10 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
return ret;
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public List<List<MeasurementDataNumericHighLowComposite>> findDataForContext(Subject subject,
EntityContext context, int definitionId, long beginTime, long endTime, int numDataPoints) {
+ MetricsServer metricsServer = storageClientManager.getMetricsServer();
if (context.type == EntityContext.Type.Resource) {
if (!authorizationManager.canViewResource(subject, context.resourceId)) {
@@ -719,8 +731,8 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
new ArrayList<List<MeasurementDataNumericHighLowComposite>>();
List<MeasurementDataNumericHighLowComposite> tempList = new ArrayList<MeasurementDataNumericHighLowComposite>();
- for (MeasurementDataNumericHighLowComposite object : metricsManager.findDataForResource(schedule.getId(),
- beginTime, endTime,numDataPoints)) {
+ for (MeasurementDataNumericHighLowComposite object : metricsServer.findDataForResource(schedule.getId(),
+ beginTime, endTime, numDataPoints)) {
tempList.add(object);
}
data.add(tempList);
@@ -742,8 +754,8 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
new ArrayList<List<MeasurementDataNumericHighLowComposite>>();
List<MeasurementDataNumericHighLowComposite> tempList = new ArrayList<MeasurementDataNumericHighLowComposite>();
- for (MeasurementDataNumericHighLowComposite object : metricsManager.findDataForResourceGroup(
- map(schedules), beginTime, endTime,numDataPoints)) {
+ for (MeasurementDataNumericHighLowComposite object : metricsServer.findDataForGroup(map(schedules),
+ beginTime, endTime,numDataPoints)) {
tempList.add(object);
}
data.add(tempList);
@@ -763,6 +775,7 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
return scheduleIds;
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public List<List<MeasurementDataNumericHighLowComposite>> findDataForResource(Subject subject, int resourceId,
int[] definitionIds, long beginTime, long endTime, int numDataPoints) {
@@ -771,6 +784,7 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
+ "] does not have permission to view measurement data for resource[id=" + resourceId + "]");
}
+ MetricsServer metricsServer = storageClientManager.getMetricsServer();
List<List<MeasurementDataNumericHighLowComposite>> results =
new ArrayList<List<MeasurementDataNumericHighLowComposite>>();
for (int nextDefinitionId : definitionIds) {
@@ -778,7 +792,8 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
false);
List<MeasurementDataNumericHighLowComposite> tempList = new ArrayList<MeasurementDataNumericHighLowComposite>();
- for(MeasurementDataNumericHighLowComposite object : metricsManager.findDataForResource(schedule.getId(), beginTime, endTime,numDataPoints) ){
+ for(MeasurementDataNumericHighLowComposite object : metricsServer.findDataForResource(schedule.getId(),
+ beginTime, endTime,numDataPoints) ){
tempList.add(object);
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MetricsManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MetricsManagerBean.java
deleted file mode 100644
index d4ecc02..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MetricsManagerBean.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * * RHQ Management Platform
- * * Copyright (C) 2005-2012 Red Hat, Inc.
- * * All rights reserved.
- * *
- * * This program is free software; you can redistribute it and/or modify
- * * it under the terms of the GNU General Public License, version 2, as
- * * published by the Free Software Foundation, and/or the GNU Lesser
- * * General Public License, version 2.1, also 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 and the GNU Lesser General Public License
- * * for more details.
- * *
- * * You should have received a copy of the GNU General Public License
- * * and the GNU Lesser General Public License along with this program;
- * * if not, write to the Free Software Foundation, Inc.,
- * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-package org.rhq.enterprise.server.measurement;
-
-import java.util.List;
-import java.util.Set;
-
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-
-import org.rhq.core.domain.measurement.MeasurementAggregate;
-import org.rhq.core.domain.measurement.MeasurementDataNumeric;
-import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
-import org.rhq.enterprise.server.storage.StorageClientManagerBean;
-import org.rhq.server.metrics.MetricsServer;
-import org.rhq.server.metrics.domain.AggregateNumericMetric;
-import org.rhq.server.metrics.domain.RawNumericMetric;
-
-/**
- * @author John Sanda
- */
-@Stateless
-public class MetricsManagerBean implements MetricsManagerLocal {
-
- @EJB
- private StorageClientManagerBean sessionManager;
-
- @Override
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public void addNumericData(Set<MeasurementDataNumeric> data, Runnable callback) {
- MetricsServer metricsServer = getMetricsServer();
- metricsServer.addNumericData(data, null);
- }
-
- @Override
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public Iterable<AggregateNumericMetric> calculateAggregates() {
- MetricsServer metricsServer = getMetricsServer();
- return metricsServer.calculateAggregates();
- }
-
- @Override
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public MeasurementDataNumeric findLatestValueForResource(int scheduleId) {
- MetricsServer metricsServer = getMetricsServer();
- RawNumericMetric metric = metricsServer.findLatestValueForResource(scheduleId);
-
- if (metric == null) {
- return null;
- }
- return new MeasurementDataNumeric(metric.getTimestamp(), scheduleId, metric.getValue());
- }
-
- @Override
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public Iterable<MeasurementDataNumericHighLowComposite> findDataForResource(int scheduleId, long beginTime,
- long endTime) {
- MetricsServer metricsServer = getMetricsServer();
- return metricsServer.findDataForResource(scheduleId, beginTime, endTime,60);
- }
-
- @Override
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public Iterable<MeasurementDataNumericHighLowComposite> findDataForResource(int scheduleId, long beginTime,
- long endTime, int numberOfBuckets) {
- MetricsServer metricsServer = getMetricsServer();
- return metricsServer.findDataForResource(scheduleId, beginTime, endTime, numberOfBuckets);
- }
-
- @Override
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public MeasurementAggregate getSummaryAggregate(int scheduleId, long beginTime, long endTime) {
- MetricsServer metricsServer = getMetricsServer();
- AggregateNumericMetric summary = metricsServer.getSummaryAggregate(scheduleId, beginTime, endTime);
-
- return new MeasurementAggregate(summary.getMin(), summary.getAvg(), summary.getMax());
- }
-
- @Override
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public MeasurementAggregate getSummaryAggregate(List<Integer> scheduleIds, long beginTime, long endTime) {
- MetricsServer metricsServer = getMetricsServer();
- AggregateNumericMetric summary = metricsServer.getSummaryAggregate(scheduleIds, beginTime, endTime);
-
- return new MeasurementAggregate(summary.getMin(), summary.getAvg(), summary.getMax());
- }
-
- @Override
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public List<MeasurementDataNumericHighLowComposite> findDataForResourceGroup(List<Integer> scheduleIds,
- long beginTime, long endTime) {
- MetricsServer metricsServer = getMetricsServer();
- return metricsServer.findDataForGroup(scheduleIds, beginTime, endTime, 60);
- }
-
- @Override
- @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
- public List<MeasurementDataNumericHighLowComposite> findDataForResourceGroup(List<Integer> scheduleIds,
- long beginTime, long endTime, int numberOfBuckets) {
- MetricsServer metricsServer = getMetricsServer();
- return metricsServer.findDataForGroup(scheduleIds, beginTime, endTime, numberOfBuckets);
- }
-
- private MetricsServer getMetricsServer() {
- return sessionManager.getMetricsServer();
- }
-}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MetricsManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MetricsManagerLocal.java
deleted file mode 100644
index 10bbe8c..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MetricsManagerLocal.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- * * RHQ Management Platform
- * * Copyright (C) 2005-2012 Red Hat, Inc.
- * * All rights reserved.
- * *
- * * This program is free software; you can redistribute it and/or modify
- * * it under the terms of the GNU General Public License, version 2, as
- * * published by the Free Software Foundation, and/or the GNU Lesser
- * * General Public License, version 2.1, also 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 and the GNU Lesser General Public License
- * * for more details.
- * *
- * * You should have received a copy of the GNU General Public License
- * * and the GNU Lesser General Public License along with this program;
- * * if not, write to the Free Software Foundation, Inc.,
- * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-package org.rhq.enterprise.server.measurement;
-
-import java.util.List;
-import java.util.Set;
-
-import javax.ejb.Local;
-
-import org.rhq.core.domain.measurement.MeasurementAggregate;
-import org.rhq.core.domain.measurement.MeasurementDataNumeric;
-import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite;
-import org.rhq.server.metrics.domain.AggregateNumericMetric;
-
-/**
- * This SLSB is (hopefully) just a temporary wrapper over {@link org.rhq.server.metrics.MetricsServer MetricsServer}.
- * This EJB is being used to delegate calls to MetricsServer since managed beans a la CDI
- * cannot be used yet. Once things are straightened out and we can use CDI, then this usage of this EJB
- * will be directly replaced with use of MetricsServer.
- *
- * @author John Sanda
- */
-@Local
-public interface MetricsManagerLocal {
-
- void addNumericData(Set<MeasurementDataNumeric> data, Runnable callback);
-
- Iterable<AggregateNumericMetric> calculateAggregates();
-
- MeasurementDataNumeric findLatestValueForResource(int scheduleId);
-
- Iterable<MeasurementDataNumericHighLowComposite> findDataForResource(int scheduleId, long beginTime, long endTime);
-
- Iterable<MeasurementDataNumericHighLowComposite> findDataForResource(int scheduleId, long beginTime, long endTime, int numberOfBuckets);
-
- Iterable<MeasurementDataNumericHighLowComposite> findDataForResourceGroup(List<Integer> scheduleIds,
- long beginTime, long endTime);
-
- Iterable<MeasurementDataNumericHighLowComposite> findDataForResourceGroup(List<Integer> scheduleIds,
- long beginTime, long endTime, int numberOfBuckets);
-
- MeasurementAggregate getSummaryAggregate(int scheduleId, long beginTime, long endTime);
-
- MeasurementAggregate getSummaryAggregate(List<Integer> scheduleIds, long beginTime, long endTime);
-
-}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJob.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJob.java
index ee99c55..61b9170 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJob.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/jobs/DataPurgeJob.java
@@ -44,11 +44,12 @@ import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementOOBManagerLocal;
-import org.rhq.enterprise.server.measurement.MetricsManagerLocal;
import org.rhq.enterprise.server.scheduler.SchedulerLocal;
+import org.rhq.enterprise.server.storage.StorageClientManagerBean;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
import org.rhq.enterprise.server.util.TimingVoodoo;
+import org.rhq.server.metrics.MetricsServer;
import org.rhq.server.metrics.domain.AggregateNumericMetric;
/**
@@ -88,7 +89,7 @@ public class DataPurgeJob extends AbstractStatefulJob {
try {
Properties systemConfig = LookupUtil.getSystemManager().getSystemConfiguration(
LookupUtil.getSubjectManager().getOverlord());
- Iterable<AggregateNumericMetric> oneHourAggregates = compressMeasurementData(LookupUtil.getMetricsManager());
+ Iterable<AggregateNumericMetric> oneHourAggregates = compressMeasurementData();
purgeEverything(systemConfig);
performDatabaseMaintenance(LookupUtil.getSystemManager(), systemConfig);
calculateAutoBaselines(LookupUtil.getMeasurementBaselineManager());
@@ -101,12 +102,14 @@ public class DataPurgeJob extends AbstractStatefulJob {
}
}
- private Iterable<AggregateNumericMetric> compressMeasurementData(MetricsManagerLocal metricsManager) {
+ private Iterable<AggregateNumericMetric> compressMeasurementData() {
long timeStart = System.currentTimeMillis();
LOG.info("Measurement data compression starting at " + new Date(timeStart));
try {
- return metricsManager.calculateAggregates();
+ StorageClientManagerBean storageClientManager = LookupUtil.getStorageClientManager();
+ MetricsServer metricsServer = storageClientManager.getMetricsServer();
+ return metricsServer.calculateAggregates();
} catch (Exception e) {
LOG.error("Failed to compress measurement data. Cause: " + e, e);
return Collections.emptyList();
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 1985b29..7f8b0fd 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -32,6 +32,8 @@ import javax.ejb.ConcurrencyManagement;
import javax.ejb.ConcurrencyManagementType;
import javax.ejb.EJB;
import javax.ejb.Singleton;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.ProtocolOptions;
@@ -176,22 +178,27 @@ public class StorageClientManagerBean {
initialized = false;
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public MetricsDAO getMetricsDAO() {
return metricsDAO;
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public MetricsServer getMetricsServer() {
return metricsServer;
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public StorageSession getSession() {
return session;
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public MetricsConfiguration getMetricsConfiguration() {
return metricsConfiguration;
}
+ @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public boolean isClusterAvailable() {
return storageClusterMonitor != null && storageClusterMonitor.isClusterAvailable();
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
index 3cde894..b29c8a4 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
@@ -146,8 +146,6 @@ import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerBean;
import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementViewManagerBean;
import org.rhq.enterprise.server.measurement.MeasurementViewManagerLocal;
-import org.rhq.enterprise.server.measurement.MetricsManagerBean;
-import org.rhq.enterprise.server.measurement.MetricsManagerLocal;
import org.rhq.enterprise.server.operation.OperationManagerBean;
import org.rhq.enterprise.server.operation.OperationManagerLocal;
import org.rhq.enterprise.server.plugin.ServerPluginsBean;
@@ -188,6 +186,7 @@ import org.rhq.enterprise.server.scheduler.SchedulerBean;
import org.rhq.enterprise.server.scheduler.SchedulerLocal;
import org.rhq.enterprise.server.search.SavedSearchManagerBean;
import org.rhq.enterprise.server.search.SavedSearchManagerLocal;
+import org.rhq.enterprise.server.storage.StorageClientManagerBean;
import org.rhq.enterprise.server.storage.StorageClusterSettingsManagerBean;
import org.rhq.enterprise.server.storage.StorageClusterSettingsManagerLocal;
import org.rhq.enterprise.server.storage.StorageNodeOperationsHandlerBean;
@@ -391,8 +390,15 @@ public final class LookupUtil {
return lookupLocal(GroupDefinitionExpressionBuilderManagerBean.class);
}
- public static MetricsManagerLocal getMetricsManager() {
- return lookupLocal(MetricsManagerBean.class);
+ public static StorageClientManagerBean getStorageClientManager() {
+ try {
+ return (StorageClientManagerBean) new InitialContext().lookup(
+ "java:global/rhq/rhq-enterprise-server-ejb3/" + StorageClientManagerBean.class.getSimpleName());
+ } catch (NamingException e) {
+ String msg = "Unable to access " + StorageClientManagerBean.class + " due to JNDI error. You may " +
+ "need to restart the server so that the storage client subsystem can be reinitialized.";
+ throw new RuntimeException(msg, e);
+ }
}
public static MeasurementDefinitionManagerLocal getMeasurementDefinitionManager() {
diff --git a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
index f69ddc1..860f823 100644
--- a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
+++ b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/MetricsServer.java
@@ -296,26 +296,32 @@ public class MetricsServer {
log.debug("Inserting " + dataSet.size() + " raw metrics");
}
- final long startTime = System.currentTimeMillis();
- final AtomicInteger remainingInserts = new AtomicInteger(dataSet.size());
-
- for (final MeasurementDataNumeric data : dataSet) {
- semaphore.acquire();
- StorageResultSetFuture resultSetFuture = dao.insertRawData(data);
- Futures.addCallback(resultSetFuture, new FutureCallback<ResultSet>() {
- @Override
- public void onSuccess(ResultSet rows) {
- updateMetricsIndex(data, dataSet.size(), remainingInserts, startTime, callback);
- }
+ final long startTime = System.currentTimeMillis();
+ final AtomicInteger remainingInserts = new AtomicInteger(dataSet.size());
+
+ for (final MeasurementDataNumeric data : dataSet) {
+ semaphore.acquire();
+ StorageResultSetFuture resultSetFuture = dao.insertRawData(data);
+ Futures.addCallback(resultSetFuture, new FutureCallback<ResultSet>() {
+ @Override
+ public void onSuccess(ResultSet rows) {
+ updateMetricsIndex(data, dataSet.size(), remainingInserts, startTime, callback);
+ }
- @Override
- public void onFailure(Throwable throwable) {
- log.error("An error occurred while inserting raw data " + data, throwable);
- callback.onFailure(throwable);
- semaphore.release();
- }
- });
- }
+ @Override
+ public void onFailure(Throwable throwable) {
+ if (log.isDebugEnabled()) {
+ log.error("An error occurred while inserting raw data " + data, throwable);
+ } else {
+ log.error(
+ "An error occurred while inserting raw data " + data + ": " +
+ throwable.getClass().getName() + ": " + throwable.getMessage());
+ }
+ callback.onFailure(throwable);
+ semaphore.release();
+ }
+ });
+ }
} catch (Exception e) {
log.error("An error occurred while inserting raw numeric data ", e);
throw new RuntimeException(e);
diff --git a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageResultSetFuture.java b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageResultSetFuture.java
index 902bf4a..59e6303 100644
--- a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageResultSetFuture.java
+++ b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageResultSetFuture.java
@@ -1,7 +1,5 @@
package org.rhq.server.metrics;
-import java.util.List;
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
@@ -18,11 +16,11 @@ public class StorageResultSetFuture implements ListenableFuture<ResultSet> {
private ResultSetFuture wrapperFuture;
- private List<StorageStateListener> listeners;
+ private StorageSession session;
- public StorageResultSetFuture(ResultSetFuture resultSetFuture, List<StorageStateListener> listeners) {
+ public StorageResultSetFuture(ResultSetFuture resultSetFuture, StorageSession session) {
wrapperFuture = resultSetFuture;
- this.listeners = listeners;
+ this.session = session;
}
@Override
@@ -45,32 +43,30 @@ public class StorageResultSetFuture implements ListenableFuture<ResultSet> {
return wrapperFuture.isDone();
}
+ /**
+ * Delegates to {@link com.datastax.driver.core.ResultSetFuture#getUninterruptibly()}
+ */
@Override
- public ResultSet get() throws InterruptedException, ExecutionException {
+ public ResultSet get() {
try {
- return wrapperFuture.get();
- } catch (ExecutionException e) {
- return handleException(e);
+ return wrapperFuture.getUninterruptibly();
+ } catch (NoHostAvailableException e) {
+ session.fireClusterDownEvent(e);
+ throw e;
}
}
+ /**
+ * Delegates to {@link ResultSetFuture#getUninterruptibly(long, java.util.concurrent.TimeUnit)}
+ */
@Override
- public ResultSet get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException,
- TimeoutException {
+ public ResultSet get(long timeout, TimeUnit unit) throws TimeoutException {
try {
- return wrapperFuture.get(timeout, unit);
- } catch (ExecutionException e) {
- return handleException(e);
+ return wrapperFuture.getUninterruptibly(timeout, unit);
+ } catch (NoHostAvailableException e) {
+ session.fireClusterDownEvent(e);
+ throw e;
}
}
- private ResultSet handleException(ExecutionException e) throws ExecutionException {
- if (e.getCause() instanceof NoHostAvailableException) {
- NoHostAvailableException cause = (NoHostAvailableException) e.getCause();
- for (StorageStateListener listener : listeners) {
- listener.onStorageClusterDown(cause);
- }
- }
- throw e;
- }
}
diff --git a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java
index 3f7af3f..5c07fde 100644
--- a/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java
+++ b/modules/enterprise/server/server-metrics/src/main/java/org/rhq/server/metrics/StorageSession.java
@@ -35,7 +35,8 @@ public class StorageSession implements Host.StateListener {
try {
return wrappedSession.execute(query);
} catch (NoHostAvailableException e) {
- return handleException(e);
+ fireClusterDownEvent(e);
+ throw e;
}
}
@@ -43,18 +44,19 @@ public class StorageSession implements Host.StateListener {
try {
return wrappedSession.execute(query);
} catch (NoHostAvailableException e) {
- return handleException(e);
+ fireClusterDownEvent(e);
+ throw e;
}
}
public StorageResultSetFuture executeAsync(String query) {
ResultSetFuture future = wrappedSession.executeAsync(query);
- return new StorageResultSetFuture(future, listeners);
+ return new StorageResultSetFuture(future, this);
}
public StorageResultSetFuture executeAsync(Query query) {
ResultSetFuture future = wrappedSession.executeAsync(query);
- return new StorageResultSetFuture(future, listeners);
+ return new StorageResultSetFuture(future, this);
}
public PreparedStatement prepare(String query) {
@@ -101,10 +103,9 @@ public class StorageSession implements Host.StateListener {
}
}
- private ResultSet handleException(NoHostAvailableException e) {
+ void fireClusterDownEvent(NoHostAvailableException e) {
for (StorageStateListener listener : listeners) {
listener.onStorageClusterDown(e);
}
- throw e;
}
}
10 years, 8 months
[rhq] 2 commits - modules/enterprise
by Jay Shaughnessy
modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf | 1 +
modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.conf | 2 ++
modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc | 4 ++--
modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-storage-wrapper.inc | 6 +++---
4 files changed, 8 insertions(+), 5 deletions(-)
New commits:
commit defe61fc07d00d7751b480aaaef4f4bfa467a1b1
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Aug 29 14:24:01 2013 -0400
tweak server wrapper files slightly to get additional java opt numbering right
diff --git a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf
index dc41ed9..a294bd1 100644
--- a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.conf
@@ -92,6 +92,7 @@ wrapper.java.additional.21="-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSIO
wrapper.java.additional.22="-Dorg.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES=text/javascript,text/css,text/html"
# use these if your JVM supports it
+# - note that if you enable these you will need to update numbering in rhq-server-wrapper.inc, if it exists
#wrapper.java.additional.23=-XX:+TieredCompilation
#wrapper.java.additional.24=-XX:+UseCompressedOops
# Don't need these now, but this is commented out in case we need to add an endorsed dir in the future
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 58f82bf..8cd24ee 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
@@ -8,8 +8,8 @@ wrapper.java.additional.23=-agentlib:jdwp=transport=dt_socket,address=8787,serve
# enable jprofiler
#set.PATH=%PATH%;<jprofiler-install-dir>\bin\windows
-#wrapper.java.additional.23=-agentlib:jprofilerti=port=8849
-#wrapper.java.additional.24=-Xbootclasspath/a:<jprofiler-install-dir>\bin\agent.jar
+#wrapper.java.additional.24=-agentlib:jprofilerti=port=8849
+#wrapper.java.additional.25=-Xbootclasspath/a:<jprofiler-install-dir>\bin\agent.jar
# disable JVM startup timeout
wrapper.startup.timeout=0
commit d3f1bf8b97e82b4745ec910f66faf18f3c5979de
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Aug 29 14:23:13 2013 -0400
[999558] Ensure the JMX interface on cassandra nodes is only bound to the loopback interface, and applies authentication and authorization
-- windows portion of this fix
diff --git a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.conf b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.conf
index de83364..b68846a 100644
--- a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.conf
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.conf
@@ -83,6 +83,8 @@ wrapper.java.additional.16="-Dcom.sun.management.jmxremote.ssl=false"
wrapper.java.additional.17="-Dcom.sun.management.jmxremote.authenticate=false"
wrapper.java.additional.18="-Dlog4j.configuration=log4j-server.properties"
wrapper.java.additional.19="-Dlog4j.defaultInitOverride=true"
+# The next one is for https://bugzilla.redhat.com/show_bug.cgi?id=999558
+wrapper.java.additional.20="-Djava.rmi.server.hostname=localhost"
# We want to make sure the Storage Node starts in the cassandra bin directory
wrapper.working.dir=%RHQ_STORAGE_HOME%/bin
diff --git a/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-storage-wrapper.inc b/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-storage-wrapper.inc
index 6941358..8f0b0eb 100644
--- a/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-storage-wrapper.inc
+++ b/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-storage-wrapper.inc
@@ -4,11 +4,11 @@
#
# override and lower the initial memory profile
-wrapper.java.additional.20=-Xms128M
-wrapper.java.additional.21=-Xmx256M
+wrapper.java.additional.21=-Xms128M
+wrapper.java.additional.22=-Xmx256M
# enable remote debugging
-#wrapper.java.additional.22=-agentlib:jdwp=transport=dt_socket,address=8788,server=y,suspend=n
+#wrapper.java.additional.23=-agentlib:jdwp=transport=dt_socket,address=8788,server=y,suspend=n
# disable JVM startup timeout
wrapper.startup.timeout=0
10 years, 8 months
[rhq] 4 commits - modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java | 11
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java | 4
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java | 223 ++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java | 106 +
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java | 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java | 3
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java | 14
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml | 1
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html | 2
modules/enterprise/gui/coregui/src/main/webapp/css/charts.css | 150 +-
modules/enterprise/gui/coregui/src/main/webapp/css/nv.d3.css | 702 ----------
modules/enterprise/gui/coregui/src/main/webapp/css/tipsy.css | 140 -
modules/enterprise/gui/coregui/src/main/webapp/js/jquery.tipsy.js | 336 ----
13 files changed, 400 insertions(+), 1300 deletions(-)
New commits:
commit 1bec04c047ae968979c25b37e9634b7b2a938934
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed Aug 28 12:54:16 2013 -0700
Fix the svg charts from cutting off at 300px. Removal of the nvd3.css code that contained the global svg css rule: display:block; width:100%; caused this.
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css b/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
index f3e8ddd..0d123b2 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
@@ -6,6 +6,21 @@
*
*/
+svg {
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ /* Trying to get SVG to act like a greedy block in all browsers */
+ display: block;
+ width:100%;
+ height:100%;
+}
+
+
+
.axis path, .axis line {
fill: none;
stroke: #000;
commit 7db3e79f58698142a93e3aeb0eaaba903eb336b2
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed Aug 28 11:19:36 2013 -0700
Change the positioning of the new chart hovers.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
index aec1707..df45c97 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
@@ -106,8 +106,7 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
svg;
// adjust the min scale so blue low line is not in axis
- function determineLowBound(min, peak) {
- //var newLow = min - ((peak - min) * 0.1);
+ function determineLowBound(min) {
newLow = min;
if (newLow < 0) {
return 0;
@@ -170,7 +169,7 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
min = $wnd.d3.min(minFiltered.map(function (d) {
return d.low;
}));
- lowBound = determineLowBound(min, peak);
+ lowBound = determineLowBound(min);
highBound = peak + ((peak - min) * 0.1);
oobMax = $wnd.d3.max(chartContext.data.map(function (d) {
if (typeof d.baselineMax === 'undefined') {
@@ -325,7 +324,7 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
metricGraphTooltipDiv = $wnd.d3.select("#metricGraphTooltip");
metricGraphTooltipDiv.style("left", + timeScale(+d.x) + 55 + "px")
- .style("top", + yScale(+d.y)+ "px");
+ .style("top", "70px");
metricGraphTooltipDiv.select("#metricGraphTooltipTimeLabel")
.text(chartContext.timeLabel);
@@ -369,8 +368,8 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
startDate = new Date(+d.x),
noDataTooltipDiv = $wnd.d3.select("#noDataTooltip");
- noDataTooltipDiv.style("left", + timeScale(+d.x)+10 + "px")
- .style("top", + yScale(+d.y)+"px");
+ noDataTooltipDiv.style("left", + timeScale(+d.x)+55 + "px")
+ .style("top", "70px");
noDataTooltipDiv.select("#noDataTooltipTimeLabel")
.text(chartContext.timeLabel);
commit 3d66ca789e3ef01d2aff8e43eb72ed553e36d161
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Tue Aug 27 15:39:28 2013 -0700
Make the new IE tooltip work for 'no data' and 'single value' bars like old tooltips.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
index 49a6f66..aec1707 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
@@ -318,22 +318,13 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
}
function showFullMetricBarHover(d){
- console.log("ShowFullMetricBarHover"+timeScale(+d.x));
+
var timeFormatter = $wnd.d3.time.format(chartContext.chartHoverTimeFormat),
dateFormatter = $wnd.d3.time.format(chartContext.chartHoverDateFormat),
startDate = new Date(+d.x),
- hoverX,
metricGraphTooltipDiv = $wnd.d3.select("#metricGraphTooltip");
- // as we approach the right margin change the side of the bar that
- // the hover is on from right to left
- if(timeScale(+d.x) > 500){
- hoverX = timeScale(+d.x) - 200;
- } else {
- hoverX = timeScale(+d.x) + 55;
- }
-
- metricGraphTooltipDiv.style("left", + hoverX + "px")
+ metricGraphTooltipDiv.style("left", + timeScale(+d.x) + 55 + "px")
.style("top", + yScale(+d.y)+ "px");
metricGraphTooltipDiv.select("#metricGraphTooltipTimeLabel")
@@ -373,12 +364,12 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
}
function showNoDataBarHover(d){
- console.log("NoData Hover"+ d.x);
var timeFormatter = $wnd.d3.time.format(chartContext.chartHoverTimeFormat),
dateFormatter = $wnd.d3.time.format(chartContext.chartHoverDateFormat),
startDate = new Date(+d.x),
- noDataTooltipDiv = $wnd.d3.select("#noDataTooltip")
- .style("left", + timeScale(+d.x)+10 + "px")
+ noDataTooltipDiv = $wnd.d3.select("#noDataTooltip");
+
+ noDataTooltipDiv.style("left", + timeScale(+d.x)+10 + "px")
.style("top", + yScale(+d.y)+"px");
noDataTooltipDiv.select("#noDataTooltipTimeLabel")
@@ -444,13 +435,21 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
showNoDataBarHover(d);
}
else {
- showFullMetricBarHover(d);
+ if(+d.high === +d.low){
+ showSingleValueMetricBarHover(d);
+ } else {
+ showFullMetricBarHover(d);
+ }
}
}).on("mouseout", function (d) {
if (d.down || d.unknown || d.nodata) {
$wnd.d3.select("#noDataTooltip").classed("hidden", true);
}else {
- $wnd.d3.select("#metricGraphTooltip").classed("hidden", true);
+ if(+d.high === +d.low){
+ $wnd.d3.select("#singleValueTooltip").classed("hidden", true);
+ } else {
+ $wnd.d3.select("#metricGraphTooltip").classed("hidden", true);
+ }
}
});
@@ -483,7 +482,6 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
.attr("opacity", 0.9)
.on("mouseover",function (d) {
showFullMetricBarHover(d);
-//
}).on("mouseout", function (d) {
if (d.down || d.unknown || d.nodata) {
$wnd.d3.select("#noDataTooltip").classed("hidden", true);
@@ -533,7 +531,7 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
startDate = new Date(+d.x),
singleValueGraphTooltipDiv = $wnd.d3.select("#singleValueTooltip")
.style("left", + timeScale(+d.x) +55 + "px")
- .style("top", + + "px");
+ .style("top", + yScale(+d.y)+ "px");
singleValueGraphTooltipDiv.select("#singleValueTooltipTimeLabel")
.text(chartContext.timeLabel);
@@ -752,52 +750,6 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
}
-// function formatHovers(chartContext, d) {
-// var hoverString,
-// xValue = (typeof d.x === 'undefined') ? 0 : +d.x,
-// date = new Date(+xValue),
-// barDuration = d.barDuration,
-// timeFormatter = $wnd.d3.time.format(chartContext.chartHoverTimeFormat),
-// dateFormatter = $wnd.d3.time.format(chartContext.chartHoverDateFormat),
-// highValue = d.high.toFixed(2),
-// lowValue = d.low.toFixed(2),
-// avgValue = d.y.toFixed(2);
-//
-//
-// // our special condition to indicate no data because avg lines dont like discontinuous data
-// if (d.y === 0 && d.high === 0 && d.low === 0) {
-// // no data
-// hoverString =
-// '<div class="chartHoverEnclosingDiv"><span class="chartHoverTimeLabel" >' + chartContext.timeLabel + ': </span>' + timeFormatter(date) +
-// '<div class="chartHoverAlignLeft"><span class="chartHoverDateLabel">' + chartContext.dateLabel + ': </span>' + dateFormatter(date) + '</div>' +
-// '<hr class="chartHoverDivider" ></hr>' +
-// '<div class="chartHoverAlignRight"><span class="chartHoverLabelSpan">' + chartContext.noDataLabel + '</span></div>' +
-// '</div>';
-//
-//
-// } else if (d.y === d.high && d.high === d.low ) {
-// // single point of data not a duration
-// hoverString =
-// '<div class="chartHoverEnclosingDiv"><span class="chartHoverTimeLabel" >' + chartContext.timeLabel + ': </span>' + timeFormatter(date) +
-// '<div class="chartHoverAlignLeft"><span class="chartHoverDateLabel">' + chartContext.dateLabel + ': </span>' + dateFormatter(date) + '</div>' +
-// '<div class="chartHoverAlignRight"><span class="chartHoverDateLabel" >' + chartContext.singleValueLabel + ': </span><span style="width:50px;">' + avgValue + '</span></div>' +
-// '</div>';
-// } else {
-// // regular bar hover for duration
-// hoverString =
-// '<div class="chartHoverEnclosingDiv"><span class="chartHoverTimeLabel">' + chartContext.timeLabel + ': </span><span style="width:50px;">' + timeFormatter(date) + '</span>' +
-// '<div class="chartHoverAlignLeft"><span class="chartHoverDateLabel">' + chartContext.dateLabel + ': </span><span style="width:50px;">' + dateFormatter(date) + '</span></div>' +
-// '<div class="chartHoverAlignLeft"><span class="chartHoverLabelSpan">' + chartContext.hoverBarLabel + ": " + barDuration + '</span></div>' +
-// '<hr class="chartHoverDivider"></hr>' +
-// '<div class="chartHoverAlignRight"><span id="chartHoverPeakValue" >' + chartContext.peakChartTitle + ': </span><span style="width:50px;">' + highValue + '</span></div>' +
-// '<div class="chartHoverAlignRight"><span id="chartHoverAvgValue" >' + chartContext.avgChartTitle + ': </span><span style="width:50px;">' + avgValue + '</span></div>' +
-// '<div class="chartHoverAlignRight"><span id="chartHoverLowValue" >' + chartContext.minChartTitle + ': </span><span style="width:50px;">' + lowValue + '</span></div>' +
-// '</div>';
-// }
-// return hoverString;
-//
-// }
-
return {
// Public API
draw: function (chartContext) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
index 57681d2..6081aef 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
@@ -168,9 +168,9 @@ public class MetricD3Graph<T extends AbstractD3GraphListView> extends EnhancedVL
+ height + "px;\">");
divAndSvgDefs.append(getSvgDefs());
divAndSvgDefs.append("</svg>");
- divAndSvgDefs.append(createMetricTooltip());
divAndSvgDefs.append(createSingleValueTooltip());
divAndSvgDefs.append(createNoDataTooltip());
+ divAndSvgDefs.append(createMetricTooltip());
divAndSvgDefs.append("</div>");
return divAndSvgDefs.toString();
@@ -180,7 +180,6 @@ public class MetricD3Graph<T extends AbstractD3GraphListView> extends EnhancedVL
StringBuilder tooltipDivs = new StringBuilder();
tooltipDivs.append("<div id=\"metricGraphTooltip\" class=\"hidden\" >");
- tooltipDivs.append("<div>");
tooltipDivs.append("<div>");
tooltipDivs.append("<span id=\"metricGraphTooltipTimeLabel\" ></span>");
@@ -220,7 +219,6 @@ public class MetricD3Graph<T extends AbstractD3GraphListView> extends EnhancedVL
tooltipDivs.append("<div/>");
- tooltipDivs.append("</div>");
tooltipDivs.append("</div>"); // end metricGraphTooltipDiv
return tooltipDivs.toString();
}
@@ -229,7 +227,6 @@ public class MetricD3Graph<T extends AbstractD3GraphListView> extends EnhancedVL
StringBuilder tooltipDivs = new StringBuilder();
tooltipDivs.append("<div id=\"noDataTooltip\" class=\"hidden\" >");
- tooltipDivs.append("<div>");
tooltipDivs.append("<div>");
tooltipDivs.append("<span id=\"noDataTooltipTimeLabel\" ></span>");
@@ -246,8 +243,7 @@ public class MetricD3Graph<T extends AbstractD3GraphListView> extends EnhancedVL
tooltipDivs.append("<div id=\"noDataLabel\" ></div>");
- tooltipDivs.append("</div>");
- tooltipDivs.append("</div>"); // end metricGraphTooltipDiv
+ tooltipDivs.append("</div>"); // end noDataTooltipDiv
return tooltipDivs.toString();
}
@@ -255,7 +251,6 @@ public class MetricD3Graph<T extends AbstractD3GraphListView> extends EnhancedVL
StringBuilder tooltipDivs = new StringBuilder();
tooltipDivs.append("<div id=\"singleValueTooltip\" class=\"hidden\" >");
- tooltipDivs.append("<div>");
tooltipDivs.append("<div>");
tooltipDivs.append("<span id=\"singleValueTooltipTimeLabel\" ></span>");
@@ -276,8 +271,7 @@ public class MetricD3Graph<T extends AbstractD3GraphListView> extends EnhancedVL
tooltipDivs.append("<span id=\"singleValueTooltipValue\" ></span>");
tooltipDivs.append("</div>");
- tooltipDivs.append("</div>");
- tooltipDivs.append("</div>"); // end metricGraphTooltipDiv
+ tooltipDivs.append("</div>"); // end singleValueTooltipDiv
return tooltipDivs.toString();
}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css b/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
index e43e3ec..f3e8ddd 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
@@ -104,7 +104,7 @@ rect.low {
height: auto;
padding: 5px;
background-color: #000;
- opacity: 0.55;
+ opacity: 0.8;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
@@ -206,17 +206,6 @@ rect.low {
color: #d3d3d6;
}
-/*#noDataTooltip {*/
- /*width: 40px;*/
- /*font-weight: bold;*/
- /*color: #d3d3d6;*/
-/*}*/
-
-/*#metricGraphTooltipMaxLabel {*/
- /*color: #1794BC;*/
-/*}*/
-
-
#singleValueTooltip {
z-index: 990000;
commit 23ca696d80fd39987e164d69fe8bdfc7939fc6aa
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Fri Aug 23 16:01:25 2013 -0700
Graph Tooltip creation to be more compatible with IE.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
index e6578ed..7c79fc4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/ButtonBarDateTimeRangeEditor.java
@@ -173,8 +173,19 @@ public class ButtonBarDateTimeRangeEditor extends EnhancedVLayout {
public void updateDateTimeRangeDisplay(Date startDate, Date endDate) {
String rangeString = fmt.format(startDate) + " - " + fmt.format(endDate);
dateRangeLabel.setContents(rangeString);
+ //setTimeRangeDuration(startDate.getTime(), endDate.getTime());
}
+ // public native String setTimeRangeDuration(double startDate, double endDate) /*-{
+
+ //var formattedDateRange = startDate.format(chartContext.buttonBarDateTimeFormat) + ' - ' + endDate.format(chartContext.buttonBarDateTimeFormat);
+ //var timeRange = endDate.from(startDate,true);
+ //$wnd.jQuery('.graphDateTimeRangeLabel').text(formattedDateRange+' ('+timeRange+')');
+ //$wnd.jQuery('.graphDateTimeRangeLabel').text('Mike you are so cool');
+
+ // }-*/;
+
+
/**
* Whenever we make a change to the date range save it here so it gets propogated to
* the correct places.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java
index eb20d40..c903e02 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/AvailabilityOverUnderGraphType.java
@@ -256,8 +256,10 @@ public class AvailabilityOverUnderGraphType implements AvailabilityGraphType {
dateFormatter = $wnd.d3.time.format(availChartContext.chartHoverDateFormat),
availStart = new Date(+d.availStart),
xPosition = parseFloat($wnd.d3.select(this).attr("x")),
+ xWidth = parseFloat($wnd.d3.select(this).attr("width")),
+ xMidPoint = xPosition + (xWidth/2),
availTooltipDiv = $wnd.d3.select("#availTooltip")
- .style("left", xPosition + "px")
+ .style("left", + xMidPoint + "px")
.style("top", "0px");
availTooltipDiv.select("#availTooltipLabel")
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
index 0c95f44..49a6f66 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/common/graph/graphtype/StackedBarMetricGraphImpl.java
@@ -122,6 +122,7 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
}
function useSmallCharts() {
+ console.log("getChartWidth: "+ getChartWidth());
return getChartWidth() <= smallChartThresholdInPixels;
}
@@ -138,7 +139,7 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
chartData = chartContext.data.slice(chartContext.data.length - numberOfBarsForSmallGraph, chartContext.data.length);
}
else {
- console.log("Using Large Charts Profile");
+ console.log("Using Large Charts Profile, width: "+ width);
// we use the width already defined above
xTicks = 8;
xTickSubDivide = 5;
@@ -316,6 +317,88 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
}
+ function showFullMetricBarHover(d){
+ console.log("ShowFullMetricBarHover"+timeScale(+d.x));
+ var timeFormatter = $wnd.d3.time.format(chartContext.chartHoverTimeFormat),
+ dateFormatter = $wnd.d3.time.format(chartContext.chartHoverDateFormat),
+ startDate = new Date(+d.x),
+ hoverX,
+ metricGraphTooltipDiv = $wnd.d3.select("#metricGraphTooltip");
+
+ // as we approach the right margin change the side of the bar that
+ // the hover is on from right to left
+ if(timeScale(+d.x) > 500){
+ hoverX = timeScale(+d.x) - 200;
+ } else {
+ hoverX = timeScale(+d.x) + 55;
+ }
+
+ metricGraphTooltipDiv.style("left", + hoverX + "px")
+ .style("top", + yScale(+d.y)+ "px");
+
+ metricGraphTooltipDiv.select("#metricGraphTooltipTimeLabel")
+ .text(chartContext.timeLabel);
+ metricGraphTooltipDiv.select("#metricGraphTooltipTimeValue")
+ .text(timeFormatter(startDate));
+
+ metricGraphTooltipDiv.select("#metricGraphTooltipDateLabel")
+ .text(chartContext.dateLabel);
+ metricGraphTooltipDiv.select("#metricGraphTooltipDateValue")
+ .text(dateFormatter(startDate));
+
+ metricGraphTooltipDiv.select("#metricGraphTooltipDurationLabel")
+ .text(chartContext.hoverBarLabel);
+ metricGraphTooltipDiv.select("#metricGraphTooltipDurationValue")
+ .text(d.barDuration);
+
+ metricGraphTooltipDiv.select("#metricGraphTooltipMaxLabel")
+ .text(chartContext.peakChartTitle);
+ metricGraphTooltipDiv.select("#metricGraphTooltipMaxValue")
+ .text(d.high.toFixed(1));
+
+ metricGraphTooltipDiv.select("#metricGraphTooltipAvgLabel")
+ .text(chartContext.avgChartTitle);
+ metricGraphTooltipDiv.select("#metricGraphTooltipAvgValue")
+ .text(d.y.toFixed(1));
+
+
+ metricGraphTooltipDiv.select("#metricGraphTooltipMinLabel")
+ .text(chartContext.minChartTitle);
+ metricGraphTooltipDiv.select("#metricGraphTooltipMinValue")
+ .text(d.low.toFixed(1));
+
+
+ //Show the tooltip
+ $wnd.d3.select("#metricGraphTooltip").classed("hidden", false);
+
+ }
+ function showNoDataBarHover(d){
+ console.log("NoData Hover"+ d.x);
+ var timeFormatter = $wnd.d3.time.format(chartContext.chartHoverTimeFormat),
+ dateFormatter = $wnd.d3.time.format(chartContext.chartHoverDateFormat),
+ startDate = new Date(+d.x),
+ noDataTooltipDiv = $wnd.d3.select("#noDataTooltip")
+ .style("left", + timeScale(+d.x)+10 + "px")
+ .style("top", + yScale(+d.y)+"px");
+
+ noDataTooltipDiv.select("#noDataTooltipTimeLabel")
+ .text(chartContext.timeLabel);
+ noDataTooltipDiv.select("#noDataTooltipTimeValue")
+ .text(timeFormatter(startDate));
+
+ noDataTooltipDiv.select("#noDataTooltipDateLabel")
+ .text(chartContext.dateLabel);
+ noDataTooltipDiv.select("#noDataTooltipDateValue")
+ .text(dateFormatter(startDate));
+
+ noDataTooltipDiv.select("#noDataLabel")
+ .text(chartContext.noDataLabel);
+
+ //Show the tooltip
+ $wnd.d3.select("#noDataTooltip").classed("hidden", false);
+
+ }
+
function createStackedBars() {
var pixelsOffHeight = 0;
@@ -356,7 +439,20 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
else {
return "#d3d3d6";
}
- });
+ }).on("mouseover",function (d) {
+ if (d.down || d.unknown || d.nodata) {
+ showNoDataBarHover(d);
+ }
+ else {
+ showFullMetricBarHover(d);
+ }
+ }).on("mouseout", function (d) {
+ if (d.down || d.unknown || d.nodata) {
+ $wnd.d3.select("#noDataTooltip").classed("hidden", true);
+ }else {
+ $wnd.d3.select("#metricGraphTooltip").classed("hidden", true);
+ }
+ });
// upper portion representing avg to high
@@ -384,7 +480,18 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
.attr("data-rhq-value", function (d) {
return d.y;
})
- .attr("opacity", 0.9);
+ .attr("opacity", 0.9)
+ .on("mouseover",function (d) {
+ showFullMetricBarHover(d);
+//
+ }).on("mouseout", function (d) {
+ if (d.down || d.unknown || d.nodata) {
+ $wnd.d3.select("#noDataTooltip").classed("hidden", true);
+ }else {
+ $wnd.d3.select("#metricGraphTooltip").classed("hidden", true);
+ }
+ });
+
// lower portion representing avg to low
@@ -409,7 +516,46 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
.attr("width", function () {
return calcBarWidth();
})
- .attr("opacity", 0.9);
+ .attr("opacity", 0.9)
+ .on("mouseover",function (d) {
+ showFullMetricBarHover(d);
+ }).on("mouseout", function (d) {
+ if (d.down || d.unknown || d.nodata) {
+ $wnd.d3.select("#noDataTooltip").classed("hidden", true);
+ }else {
+ $wnd.d3.select("#metricGraphTooltip").classed("hidden", true);
+ }
+ });
+
+ function showSingleValueMetricBarHover(d){
+ var timeFormatter = $wnd.d3.time.format(chartContext.chartHoverTimeFormat),
+ dateFormatter = $wnd.d3.time.format(chartContext.chartHoverDateFormat),
+ startDate = new Date(+d.x),
+ singleValueGraphTooltipDiv = $wnd.d3.select("#singleValueTooltip")
+ .style("left", + timeScale(+d.x) +55 + "px")
+ .style("top", + + "px");
+
+ singleValueGraphTooltipDiv.select("#singleValueTooltipTimeLabel")
+ .text(chartContext.timeLabel);
+ singleValueGraphTooltipDiv.select("#singleValueTooltipTimeValue")
+ .text(timeFormatter(startDate));
+
+ singleValueGraphTooltipDiv.select("#singleValueTooltipDateLabel")
+ .text(chartContext.dateLabel);
+ singleValueGraphTooltipDiv.select("#singleValueTooltipDateValue")
+ .text(dateFormatter(startDate));
+
+ singleValueGraphTooltipDiv.select("#singleValueTooltipValueLabel")
+ .text(chartContext.singleValueLabel);
+ singleValueGraphTooltipDiv.select("#singleValueTooltipValue")
+ .text(d.y.toFixed(1));
+
+
+ //Show the tooltip
+ $wnd.d3.select("#singleValueTooltip").classed("hidden", false);
+
+ }
+
// if high == low put a "cap" on the bar to show non-aggregated bar
svg.selectAll("rect.singleValue")
@@ -446,6 +592,10 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
else {
return "#70c4e2";
}
+ }).on("mouseover",function (d) {
+ showSingleValueMetricBarHover(d);
+ }).on("mouseout", function () {
+ $wnd.d3.select("#singleValueTooltip").classed("hidden", true);
});
}
@@ -602,66 +752,51 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
}
- function formatHovers(chartContext, d) {
- var hoverString,
- xValue = (typeof d.x === 'undefined') ? 0 : +d.x,
- date = new Date(+xValue),
- barDuration = d.barDuration,
- timeFormatter = $wnd.d3.time.format(chartContext.chartHoverTimeFormat),
- dateFormatter = $wnd.d3.time.format(chartContext.chartHoverDateFormat),
- highValue = d.high.toFixed(2),
- lowValue = d.low.toFixed(2),
- avgValue = d.y.toFixed(2);
-
-
- // our special condition to indicate no data because avg lines dont like discontinuous data
- if (d.y === 0 && d.high === 0 && d.low === 0) {
- // no data
- hoverString =
- '<div class="chartHoverEnclosingDiv"><span class="chartHoverTimeLabel" >' + chartContext.timeLabel + ': </span>' + timeFormatter(date) +
- '<div class="chartHoverAlignLeft"><span class="chartHoverDateLabel">' + chartContext.dateLabel + ': </span>' + dateFormatter(date) + '</div>' +
- '<hr class="chartHoverDivider" ></hr>' +
- '<div class="chartHoverAlignRight"><span class="chartHoverLabelSpan">' + chartContext.noDataLabel + '</span></div>' +
- '</div>';
-
-
- } else if (d.y === d.high && d.high === d.low ) {
- // single point of data not a duration
- hoverString =
- '<div class="chartHoverEnclosingDiv"><span class="chartHoverTimeLabel" >' + chartContext.timeLabel + ': </span>' + timeFormatter(date) +
- '<div class="chartHoverAlignLeft"><span class="chartHoverDateLabel">' + chartContext.dateLabel + ': </span>' + dateFormatter(date) + '</div>' +
- '<div class="chartHoverAlignRight"><span class="chartHoverDateLabel" >' + chartContext.singleValueLabel + ': </span><span style="width:50px;">' + avgValue + '</span></div>' +
- '</div>';
- } else {
- // regular bar hover for duration
- hoverString =
- '<div class="chartHoverEnclosingDiv"><span class="chartHoverTimeLabel">' + chartContext.timeLabel + ': </span><span style="width:50px;">' + timeFormatter(date) + '</span>' +
- '<div class="chartHoverAlignLeft"><span class="chartHoverDateLabel">' + chartContext.dateLabel + ': </span><span style="width:50px;">' + dateFormatter(date) + '</span></div>' +
- '<div class="chartHoverAlignLeft"><span class="chartHoverLabelSpan">' + chartContext.hoverBarLabel + ": " + barDuration + '</span></div>' +
- '<hr class="chartHoverDivider"></hr>' +
- '<div class="chartHoverAlignRight"><span id="chartHoverPeakValue" >' + chartContext.peakChartTitle + ': </span><span style="width:50px;">' + highValue + '</span></div>' +
- '<div class="chartHoverAlignRight"><span id="chartHoverAvgValue" >' + chartContext.avgChartTitle + ': </span><span style="width:50px;">' + avgValue + '</span></div>' +
- '<div class="chartHoverAlignRight"><span id="chartHoverLowValue" >' + chartContext.minChartTitle + ': </span><span style="width:50px;">' + lowValue + '</span></div>' +
- '</div>';
- }
- return hoverString;
-
- }
-
- function createHovers(chartContext) {
- $wnd.jQuery('svg rect.leaderBar, svg rect.high, svg rect.low, svg rect.singleValue').tipsy({
- gravity: 'w',
- html: true,
- trigger: 'hover',
- title: function () {
- var d = this.__data__;
- return formatHovers(chartContext, d);
- },
- show: function (e, el) {
- el.css({ 'z-index': '990000'})
- }
- });
- }
+// function formatHovers(chartContext, d) {
+// var hoverString,
+// xValue = (typeof d.x === 'undefined') ? 0 : +d.x,
+// date = new Date(+xValue),
+// barDuration = d.barDuration,
+// timeFormatter = $wnd.d3.time.format(chartContext.chartHoverTimeFormat),
+// dateFormatter = $wnd.d3.time.format(chartContext.chartHoverDateFormat),
+// highValue = d.high.toFixed(2),
+// lowValue = d.low.toFixed(2),
+// avgValue = d.y.toFixed(2);
+//
+//
+// // our special condition to indicate no data because avg lines dont like discontinuous data
+// if (d.y === 0 && d.high === 0 && d.low === 0) {
+// // no data
+// hoverString =
+// '<div class="chartHoverEnclosingDiv"><span class="chartHoverTimeLabel" >' + chartContext.timeLabel + ': </span>' + timeFormatter(date) +
+// '<div class="chartHoverAlignLeft"><span class="chartHoverDateLabel">' + chartContext.dateLabel + ': </span>' + dateFormatter(date) + '</div>' +
+// '<hr class="chartHoverDivider" ></hr>' +
+// '<div class="chartHoverAlignRight"><span class="chartHoverLabelSpan">' + chartContext.noDataLabel + '</span></div>' +
+// '</div>';
+//
+//
+// } else if (d.y === d.high && d.high === d.low ) {
+// // single point of data not a duration
+// hoverString =
+// '<div class="chartHoverEnclosingDiv"><span class="chartHoverTimeLabel" >' + chartContext.timeLabel + ': </span>' + timeFormatter(date) +
+// '<div class="chartHoverAlignLeft"><span class="chartHoverDateLabel">' + chartContext.dateLabel + ': </span>' + dateFormatter(date) + '</div>' +
+// '<div class="chartHoverAlignRight"><span class="chartHoverDateLabel" >' + chartContext.singleValueLabel + ': </span><span style="width:50px;">' + avgValue + '</span></div>' +
+// '</div>';
+// } else {
+// // regular bar hover for duration
+// hoverString =
+// '<div class="chartHoverEnclosingDiv"><span class="chartHoverTimeLabel">' + chartContext.timeLabel + ': </span><span style="width:50px;">' + timeFormatter(date) + '</span>' +
+// '<div class="chartHoverAlignLeft"><span class="chartHoverDateLabel">' + chartContext.dateLabel + ': </span><span style="width:50px;">' + dateFormatter(date) + '</span></div>' +
+// '<div class="chartHoverAlignLeft"><span class="chartHoverLabelSpan">' + chartContext.hoverBarLabel + ": " + barDuration + '</span></div>' +
+// '<hr class="chartHoverDivider"></hr>' +
+// '<div class="chartHoverAlignRight"><span id="chartHoverPeakValue" >' + chartContext.peakChartTitle + ': </span><span style="width:50px;">' + highValue + '</span></div>' +
+// '<div class="chartHoverAlignRight"><span id="chartHoverAvgValue" >' + chartContext.avgChartTitle + ': </span><span style="width:50px;">' + avgValue + '</span></div>' +
+// '<div class="chartHoverAlignRight"><span id="chartHoverLowValue" >' + chartContext.minChartTitle + ': </span><span style="width:50px;">' + lowValue + '</span></div>' +
+// '</div>';
+// }
+// return hoverString;
+//
+// }
return {
// Public API
@@ -685,7 +820,6 @@ public class StackedBarMetricGraphImpl extends AbstractMetricGraph {
console.log("OOB Data Exists!");
createOOBLines();
}
- createHovers(chartContext);
}
}
}; // end public closure
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
index 20eb39b..57681d2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/MetricD3Graph.java
@@ -167,10 +167,120 @@ public class MetricD3Graph<T extends AbstractD3GraphListView> extends EnhancedVL
+ "\" ><svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" style=\"height:"
+ height + "px;\">");
divAndSvgDefs.append(getSvgDefs());
- divAndSvgDefs.append("</svg></div>");
+ divAndSvgDefs.append("</svg>");
+ divAndSvgDefs.append(createMetricTooltip());
+ divAndSvgDefs.append(createSingleValueTooltip());
+ divAndSvgDefs.append(createNoDataTooltip());
+ divAndSvgDefs.append("</div>");
+
return divAndSvgDefs.toString();
}
+ private static String createMetricTooltip() {
+ StringBuilder tooltipDivs = new StringBuilder();
+
+ tooltipDivs.append("<div id=\"metricGraphTooltip\" class=\"hidden\" >");
+ tooltipDivs.append("<div>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipTimeLabel\" ></span>");
+ tooltipDivs.append("<span>: </span>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipTimeValue\" ></span>");
+ tooltipDivs.append("</div>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipDateLabel\" ></span>");
+ tooltipDivs.append("<span>: </span>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipDateValue\" ></span>");
+ tooltipDivs.append("</div>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipDurationLabel\" ></span>");
+ tooltipDivs.append("<span>: </span>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipDurationValue\" ></span>");
+ tooltipDivs.append("<div/>");
+ tooltipDivs.append("<hr></hr>");
+
+ tooltipDivs.append("<div >");
+ tooltipDivs.append("<span id=\"metricGraphTooltipMaxLabel\" ></span>");
+ tooltipDivs.append("<span> : </span>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipMaxValue\" ></span>");
+ tooltipDivs.append("<div/>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipAvgLabel\" ></span>");
+ tooltipDivs.append("<span> : </span>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipAvgValue\" ></span>");
+ tooltipDivs.append("<div/>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipMinLabel\" ></span>");
+ tooltipDivs.append("<span> : </span>");
+ tooltipDivs.append("<span id=\"metricGraphTooltipMinValue\" ></span>");
+ tooltipDivs.append("<div/>");
+
+
+ tooltipDivs.append("</div>");
+ tooltipDivs.append("</div>"); // end metricGraphTooltipDiv
+ return tooltipDivs.toString();
+ }
+
+ private static String createNoDataTooltip() {
+ StringBuilder tooltipDivs = new StringBuilder();
+
+ tooltipDivs.append("<div id=\"noDataTooltip\" class=\"hidden\" >");
+ tooltipDivs.append("<div>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"noDataTooltipTimeLabel\" ></span>");
+ tooltipDivs.append("<span>: </span>");
+ tooltipDivs.append("<span id=\"noDataTooltipTimeValue\" ></span>");
+ tooltipDivs.append("</div>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"noDataTooltipDateLabel\" ></span>");
+ tooltipDivs.append("<span>: </span>");
+ tooltipDivs.append("<span id=\"noDataTooltipDateValue\" ></span>");
+ tooltipDivs.append("</div>");
+ tooltipDivs.append("<hr></hr>");
+
+ tooltipDivs.append("<div id=\"noDataLabel\" ></div>");
+
+ tooltipDivs.append("</div>");
+ tooltipDivs.append("</div>"); // end metricGraphTooltipDiv
+ return tooltipDivs.toString();
+ }
+
+ private static String createSingleValueTooltip() {
+ StringBuilder tooltipDivs = new StringBuilder();
+
+ tooltipDivs.append("<div id=\"singleValueTooltip\" class=\"hidden\" >");
+ tooltipDivs.append("<div>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"singleValueTooltipTimeLabel\" ></span>");
+ tooltipDivs.append("<span>: </span>");
+ tooltipDivs.append("<span id=\"singleValueTooltipTimeValue\" ></span>");
+ tooltipDivs.append("</div>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"singleValueTooltipDateLabel\" ></span>");
+ tooltipDivs.append("<span>: </span>");
+ tooltipDivs.append("<span id=\"singleValueTooltipDateValue\" ></span>");
+ tooltipDivs.append("</div>");
+ tooltipDivs.append("<hr></hr>");
+
+ tooltipDivs.append("<div>");
+ tooltipDivs.append("<span id=\"singleValueTooltipValueLabel\" ></span>");
+ tooltipDivs.append("<span>: </span>");
+ tooltipDivs.append("<span id=\"singleValueTooltipValue\" ></span>");
+ tooltipDivs.append("</div>");
+
+ tooltipDivs.append("</div>");
+ tooltipDivs.append("</div>"); // end metricGraphTooltipDiv
+ return tooltipDivs.toString();
+ }
+
/**
* Delegate the call to rendering the JSNI chart.
* This way the chart type can be swapped out at any time.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java
index 2c3a4c7..b914cd4 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/avail/AvailabilityD3GraphView.java
@@ -85,6 +85,12 @@ public class AvailabilityD3GraphView<T extends AvailabilityGraphType> extends En
+ "\" ><svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" style=\"height:65px;\">");
divAndSvgDefs.append(getSvgDefs());
divAndSvgDefs.append("</svg>");
+ createTooltip(divAndSvgDefs);
+ divAndSvgDefs.append("</div>");
+ return divAndSvgDefs.toString();
+ }
+
+ private void createTooltip(StringBuilder divAndSvgDefs) {
divAndSvgDefs.append("<div id=\"availTooltip\" class=\"hidden\" >");
divAndSvgDefs.append("<div>");
divAndSvgDefs.append("<span id=\"availTooltipLabel\" class=\"availTooltipLabel\"></span>");
@@ -99,8 +105,6 @@ public class AvailabilityD3GraphView<T extends AvailabilityGraphType> extends En
divAndSvgDefs.append("<span id=\"availTooltipStartTime\" ></span>");
divAndSvgDefs.append("</div>");
divAndSvgDefs.append("</div>"); // end availTooltipDiv
- divAndSvgDefs.append("</div>");
- return divAndSvgDefs.toString();
}
public void addGraphMarkerComponent(){
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
index d856410..32436b0 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsResourceView.java
@@ -65,6 +65,7 @@ public class MetricsResourceView extends AbstractD3GraphListView {
this.resource = resource;
metricsTableView = new MetricsTableView(resource, this);
availabilityDetails = new ResourceMetricAvailabilityView(resource);
+
}
@@ -158,6 +159,8 @@ public class MetricsResourceView extends AbstractD3GraphListView {
@Override
public void run() {
availabilityGraph.drawJsniChart();
+ metricsTableView.refreshOpenGridRows();
+
}
}.schedule(150);
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
index 242efe0..525ec42 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/table/MetricsTableView.java
@@ -265,6 +265,20 @@ public class MetricsTableView extends Table<MetricsViewDataSource> implements Re
}
+ public void refreshOpenGridRows(){
+ ListGridRecord[] metricsRecords = metricsTableListGrid.getRecords();
+ for (int i = 0; i < metricsRecords.length; i++) {
+ ListGridRecord metricsRecord = metricsRecords[i];
+ if(null != metricsRecord){
+ int metricDefinitionId = metricsRecord
+ .getAttributeAsInt(MetricsViewDataSource.FIELD_METRIC_DEF_ID);
+ if(expandedRows.contains(metricDefinitionId)){
+ metricsTableListGrid.expandRecord(metricsRecord);
+ }
+ }
+ }
+ }
+
public class MetricsTableListGrid extends ListGrid {
private static final int TREEVIEW_DETAIL_CHART_HEIGHT = 205;
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
index 8ef78e0..a71b26e 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/CoreGUI.gwt.xml
@@ -58,7 +58,6 @@
<script src="/coregui/js/jquery-1.7.2.min.js"/>
<script src="/coregui/js/jquery.sparkline-2.1.min.js"/>
<script src="/coregui/js/d3.v3.min.js"/>
- <script src="/coregui/js/jquery.tipsy.js"/>
<!--
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
index 32c5789..2567253 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
@@ -12,8 +12,6 @@
<link rel="stylesheet" href="CoreGUI.css">
<!-- for d3 charting -->
- <link rel="stylesheet" href="css/nv.d3.css">
- <link rel="stylesheet" href="css/tipsy.css">
<link rel="stylesheet" href="css/charts.css">
<script type="text/javascript">
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css b/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
index 6a004b4..e43e3ec 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
+++ b/modules/enterprise/gui/coregui/src/main/webapp/css/charts.css
@@ -93,78 +93,99 @@ rect.low {
fill: #70c4e2;
}
-/**
- * CSS for html chart hovers.
- */
-.chartHoverEnclosingDiv {
- text-align: left;
- z-index: 990000;
-}
-.chartHoverAlignLeft {
- text-align: left;
-}
-.chartHoverAlignRight {
- text-align: right;
+/* CSS for new Chart Hovers*/
+
+#availTooltip {
+ z-index: 990000;
+ position: absolute;
+ width: 150px;
+ height: auto;
+ padding: 5px;
+ background-color: #000;
+ opacity: 0.55;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
+ -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
+ box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
+ pointer-events: none;
}
-.chartHoverDivider {
- width: 100%;
- text-align: center;
- border: #d3d3d3 solid thin;
+#availTooltip.hidden {
+ display: none;
}
-.chartHoverLabelSpan {
- width: 100%;
- font-weight: bold;
+#availTooltip div {
+ margin: 0;
+ font-family: Arial, Verdana, sans-serif;
+ font-size: 9px;
color: #d3d3d6;
}
-.chartHoverTimeLabel {
- width: 50px;
+.availTooltipLabel {
+ width: 40px;
font-weight: bold;
color: #d3d3d6;
}
-.chartHoverDateLabel {
- width: 50px;
- font-weight: bold;
+/* CSS for metric graph tooltips */
+#metricGraphTooltip {
+ z-index: 990000;
+ position: absolute;
+ width: 100px;
+ height: auto;
+ padding: 5px;
+ background-color: #000;
+ opacity: 0.80;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
+ -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
+ box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
+ pointer-events: none;
+}
+
+#metricGraphTooltip.hidden {
+ display: none;
+}
+
+#metricGraphTooltip div {
+ margin: 0;
+ font-family: Arial, Verdana, sans-serif;
+ font-size: 10px;
color: #d3d3d6;
}
-#chartHoverDownValue {
- width: 100%;
+#metricGraphTooltipLabel {
+ width: 40px;
font-weight: bold;
- color: #ff8a9a;
+ color: #d3d3d6;
}
-#chartHoverPeakValue {
- width: 50px;
- font-weight: bold;
+#metricGraphTooltipMaxLabel {
color: #1794BC;
}
-#chartHoverAvgValue {
- width: 50px;
- font-weight: bold;
+#metricGraphTooltipAvgLabel {
color: #2e376a;
}
-#chartHoverLowValue {
- width: 50px;
- font-weight: bold;
+#metricGraphTooltipMinLabel {
color: #70c4e2;
}
-#availTooltip {
+#noDataTooltip {
z-index: 990000;
position: absolute;
- width: 150px;
+ width: 100px;
height: auto;
padding: 5px;
background-color: #000;
- opacity: 0.55;
+ opacity: 0.80;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
@@ -174,21 +195,54 @@ rect.low {
pointer-events: none;
}
-#availTooltip.hidden {
+#noDataTooltip.hidden {
display: none;
}
-#availTooltip div {
+#noDataTooltip div {
margin: 0;
font-family: Arial, Verdana, sans-serif;
- font-size: 9px;
+ font-size: 10px;
color: #d3d3d6;
}
-.availTooltipLabel {
- width: 40px;
- font-weight: bold;
- color: #d3d3d6;
+/*#noDataTooltip {*/
+ /*width: 40px;*/
+ /*font-weight: bold;*/
+ /*color: #d3d3d6;*/
+/*}*/
+
+/*#metricGraphTooltipMaxLabel {*/
+ /*color: #1794BC;*/
+/*}*/
+
+
+
+#singleValueTooltip {
+ z-index: 990000;
+ position: absolute;
+ width: 100px;
+ height: auto;
+ padding: 5px;
+ background-color: #000;
+ opacity: 0.80;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
+ -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
+ box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4);
+ pointer-events: none;
+}
+
+#singleValueTooltip.hidden {
+ display: none;
}
+#singleValueTooltip div {
+ margin: 0;
+ font-family: Arial, Verdana, sans-serif;
+ font-size: 10px;
+ color: #d3d3d6;
+}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/nv.d3.css b/modules/enterprise/gui/coregui/src/main/webapp/css/nv.d3.css
deleted file mode 100755
index 163b9a8..0000000
--- a/modules/enterprise/gui/coregui/src/main/webapp/css/nv.d3.css
+++ /dev/null
@@ -1,702 +0,0 @@
-
-/********************
- * HTML CSS
- */
-
-
-.chartWrap {
- margin: 0;
- padding: 0;
- overflow: hidden;
-}
-
-
-/********************
- * TOOLTIP CSS
- */
-
-.nvtooltip {
- position: absolute;
- background-color: rgba(255,255,255,1);
- padding: 1px;
- border: 1px solid rgba(0,0,0,.2);
- z-index: 10000;
-
- font-family: Arial;
- font-size: 13px;
-
- transition: opacity 500ms linear;
- -moz-transition: opacity 500ms linear;
- -webkit-transition: opacity 500ms linear;
-
- transition-delay: 500ms;
- -moz-transition-delay: 500ms;
- -webkit-transition-delay: 500ms;
-
- -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
- -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
- box-shadow: 0 5px 10px rgba(0,0,0,.2);
-
- -webkit-border-radius: 6px;
- -moz-border-radius: 6px;
- border-radius: 6px;
-
- pointer-events: none;
-
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.nvtooltip.x-nvtooltip,
-.nvtooltip.y-nvtooltip {
- padding: 8px;
-}
-
-.nvtooltip h3 {
- margin: 0;
- padding: 4px 14px;
- line-height: 18px;
- font-weight: normal;
- background-color: #f7f7f7;
- text-align: center;
-
- border-bottom: 1px solid #ebebeb;
-
- -webkit-border-radius: 5px 5px 0 0;
- -moz-border-radius: 5px 5px 0 0;
- border-radius: 5px 5px 0 0;
-}
-
-.nvtooltip p {
- margin: 0;
- padding: 5px 14px;
- text-align: center;
-}
-
-.nvtooltip span {
- display: inline-block;
- margin: 2px 0;
-}
-
-.nvtooltip-pending-removal {
- position: absolute;
- pointer-events: none;
-}
-
-
-/********************
- * SVG CSS
- */
-
-
-svg {
- -webkit-touch-callout: none;
- -webkit-user-select: none;
- -khtml-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- /* Trying to get SVG to act like a greedy block in all browsers */
- display: block;
- width:100%;
- height:100%;
-}
-
-
-svg text {
- font: normal 12px Arial;
-}
-
-svg .title {
- font: bold 14px Arial;
-}
-
-.nvd3 .nv-background {
- fill: white;
- fill-opacity: 0;
- /*
- pointer-events: none;
- */
-}
-
-.nvd3.nv-noData {
- font-size: 18px;
- font-weight: bold;
-}
-
-
-/**********
-* Brush
-*/
-
-.nv-brush .extent {
- fill-opacity: .125;
- shape-rendering: crispEdges;
-}
-
-
-
-/**********
-* Legend
-*/
-
-.nvd3 .nv-legend .nv-series {
- cursor: pointer;
-}
-
-.nvd3 .nv-legend .disabled circle {
- fill-opacity: 0;
-}
-
-
-
-/**********
-* Axes
-*/
-
-.nvd3 .nv-axis path {
- fill: none;
- stroke: #000;
- stroke-opacity: .75;
- shape-rendering: crispEdges;
-}
-
-.nvd3 .nv-axis path.domain {
- stroke-opacity: .75;
-}
-
-.nvd3 .nv-axis.nv-x path.domain {
- stroke-opacity: 0;
-}
-
-.nvd3 .nv-axis line {
- fill: none;
- stroke: #000;
- stroke-opacity: .25;
- shape-rendering: crispEdges;
-}
-
-.nvd3 .nv-axis line.zero {
- stroke-opacity: .75;
-}
-
-.nvd3 .nv-axis .nv-axisMaxMin text {
- font-weight: bold;
-}
-
-.nvd3 .x .nv-axis .nv-axisMaxMin text,
-.nvd3 .x2 .nv-axis .nv-axisMaxMin text,
-.nvd3 .x3 .nv-axis .nv-axisMaxMin text {
- text-anchor: middle
-}
-
-
-
-/**********
-* Brush
-*/
-
-.nv-brush .resize path {
- fill: #eee;
- stroke: #666;
-}
-
-
-
-/**********
-* Bars
-*/
-
-.nvd3 .nv-bars .negative rect {
- zfill: brown;
-}
-
-.nvd3 .nv-bars rect {
- zfill: steelblue;
- fill-opacity: .75;
-
- transition: fill-opacity 250ms linear;
- -moz-transition: fill-opacity 250ms linear;
- -webkit-transition: fill-opacity 250ms linear;
-}
-
-.nvd3 .nv-bars rect:hover {
- fill-opacity: 1;
-}
-
-.nvd3 .nv-bars .hover rect {
- fill: lightblue;
-}
-
-.nvd3 .nv-bars text {
- fill: rgba(0,0,0,0);
-}
-
-.nvd3 .nv-bars .hover text {
- fill: rgba(0,0,0,1);
-}
-
-
-/**********
-* Bars
-*/
-
-.nvd3 .nv-multibar .nv-groups rect,
-.nvd3 .nv-multibarHorizontal .nv-groups rect,
-.nvd3 .nv-discretebar .nv-groups rect {
- stroke-opacity: 0;
-
- transition: fill-opacity 250ms linear;
- -moz-transition: fill-opacity 250ms linear;
- -webkit-transition: fill-opacity 250ms linear;
-}
-
-.nvd3 .nv-multibar .nv-groups rect:hover,
-.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,
-.nvd3 .nv-discretebar .nv-groups rect:hover {
- fill-opacity: 1;
-}
-
-.nvd3 .nv-discretebar .nv-groups text,
-.nvd3 .nv-multibarHorizontal .nv-groups text {
- font-weight: bold;
- fill: rgba(0,0,0,1);
- stroke: rgba(0,0,0,0);
-}
-
-/***********
-* Pie Chart
-*/
-
-.nvd3.nv-pie path {
- stroke-opacity: 0;
-
- transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear;
- -moz-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear;
- -webkit-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear;
-
-}
-
-.nvd3.nv-pie .nv-slice text {
- stroke: #000;
- stroke-width: 0;
-}
-
-.nvd3.nv-pie path {
- stroke: #fff;
- stroke-width: 1px;
- stroke-opacity: 1;
-}
-
-.nvd3.nv-pie .hover path {
- fill-opacity: .7;
-/*
- stroke-width: 6px;
- stroke-opacity: 1;
-*/
-}
-
-.nvd3.nv-pie .nv-label rect {
- fill-opacity: 0;
- stroke-opacity: 0;
-}
-
-/**********
-* Lines
-*/
-
-.nvd3 .nv-groups path.nv-line {
- fill: none;
- stroke-width: 2.5px;
- /*
- stroke-linecap: round;
- shape-rendering: geometricPrecision;
-
- transition: stroke-width 250ms linear;
- -moz-transition: stroke-width 250ms linear;
- -webkit-transition: stroke-width 250ms linear;
-
- transition-delay: 250ms
- -moz-transition-delay: 250ms;
- -webkit-transition-delay: 250ms;
- */
-}
-
-.nvd3 .nv-groups path.nv-area {
- stroke: none;
- /*
- stroke-linecap: round;
- shape-rendering: geometricPrecision;
-
- stroke-width: 2.5px;
- transition: stroke-width 250ms linear;
- -moz-transition: stroke-width 250ms linear;
- -webkit-transition: stroke-width 250ms linear;
-
- transition-delay: 250ms
- -moz-transition-delay: 250ms;
- -webkit-transition-delay: 250ms;
- */
-}
-
-.nvd3 .nv-line.hover path {
- stroke-width: 6px;
-}
-
-/*
-.nvd3.scatter .groups .point {
- fill-opacity: 0.1;
- stroke-opacity: 0.1;
-}
- */
-
-.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point {
- fill-opacity: 0;
- stroke-opacity: 0;
-}
-
-.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point {
- fill-opacity: .5 !important;
- stroke-opacity: .5 !important;
-}
-
-
-.nvd3 .nv-groups .nv-point {
- transition: stroke-width 250ms linear, stroke-opacity 250ms linear;
- -moz-transition: stroke-width 250ms linear, stroke-opacity 250ms linear;
- -webkit-transition: stroke-width 250ms linear, stroke-opacity 250ms linear;
-}
-
-.nvd3.nv-scatter .nv-groups .nv-point.hover,
-.nvd3 .nv-groups .nv-point.hover {
- stroke-width: 20px;
- fill-opacity: .5 !important;
- stroke-opacity: .5 !important;
-}
-
-
-.nvd3 .nv-point-paths path {
- stroke: #aaa;
- stroke-opacity: 0;
- fill: #eee;
- fill-opacity: 0;
-}
-
-
-
-.nvd3 .nv-indexLine {
- cursor: ew-resize;
-}
-
-
-/**********
-* Distribution
-*/
-
-.nvd3 .nv-distribution {
- pointer-events: none;
-}
-
-
-
-/**********
-* Scatter
-*/
-
-/* **Attempting to remove this for useVoronoi(false), need to see if it's required anywhere
-.nvd3 .nv-groups .nv-point {
- pointer-events: none;
-}
-*/
-
-.nvd3 .nv-groups .nv-point.hover {
- stroke-width: 20px;
- stroke-opacity: .5;
-}
-
-.nvd3 .nv-scatter .nv-point.hover {
- fill-opacity: 1;
-}
-
-/*
-.nv-group.hover .nv-point {
- fill-opacity: 1;
-}
-*/
-
-
-/**********
-* Stacked Area
-*/
-
-.nvd3.nv-stackedarea path.nv-area {
- fill-opacity: .7;
- /*
- stroke-opacity: .65;
- fill-opacity: 1;
- */
- stroke-opacity: 0;
-
- transition: fill-opacity 250ms linear, stroke-opacity 250ms linear;
- -moz-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear;
- -webkit-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear;
-
- /*
- transition-delay: 500ms;
- -moz-transition-delay: 500ms;
- -webkit-transition-delay: 500ms;
- */
-
-}
-
-.nvd3.nv-stackedarea path.nv-area.hover {
- fill-opacity: .9;
- /*
- stroke-opacity: .85;
- */
-}
-/*
-.d3stackedarea .groups path {
- stroke-opacity: 0;
-}
- */
-
-
-
-.nvd3.nv-stackedarea .nv-groups .nv-point {
- stroke-opacity: 0;
- fill-opacity: 0;
-}
-
-.nvd3.nv-stackedarea .nv-groups .nv-point.hover {
- stroke-width: 20px;
- stroke-opacity: .75;
- fill-opacity: 1;
-}
-
-
-
-/**********
-* Line Plus Bar
-*/
-
-.nvd3.nv-linePlusBar .nv-bar rect {
- fill-opacity: .75;
-}
-
-.nvd3.nv-linePlusBar .nv-bar rect:hover {
- fill-opacity: 1;
-}
-
-
-/**********
-* Bullet
-*/
-
-.nvd3.nv-bullet { font: 10px sans-serif; }
-.nvd3.nv-bullet .nv-measure { fill-opacity: .8; }
-.nvd3.nv-bullet .nv-measure:hover { fill-opacity: 1; }
-.nvd3.nv-bullet .nv-marker { stroke: #000; stroke-width: 2px; }
-.nvd3.nv-bullet .nv-markerTriangle { stroke: #000; fill: #fff; stroke-width: 1.5px; }
-.nvd3.nv-bullet .nv-tick line { stroke: #666; stroke-width: .5px; }
-.nvd3.nv-bullet .nv-range.nv-s0 { fill: #eee; }
-.nvd3.nv-bullet .nv-range.nv-s1 { fill: #ddd; }
-.nvd3.nv-bullet .nv-range.nv-s2 { fill: #ccc; }
-.nvd3.nv-bullet .nv-title { font-size: 14px; font-weight: bold; }
-.nvd3.nv-bullet .nv-subtitle { fill: #999; }
-
-
-.nvd3.nv-bullet .nv-range {
- fill: #999;
- fill-opacity: .4;
-}
-.nvd3.nv-bullet .nv-range:hover {
- fill-opacity: .7;
-}
-
-
-
-/**********
-* Sparkline
-*/
-
-.nvd3.nv-sparkline path {
- fill: none;
-}
-
-.nvd3.nv-sparklineplus g.nv-hoverValue {
- pointer-events: none;
-}
-
-.nvd3.nv-sparklineplus .nv-hoverValue line {
- stroke: #333;
- stroke-width: 1.5px;
- }
-
-.nvd3.nv-sparklineplus,
-.nvd3.nv-sparklineplus g {
- pointer-events: all;
-}
-
-.nvd3 .nv-hoverArea {
- fill-opacity: 0;
- stroke-opacity: 0;
-}
-
-.nvd3.nv-sparklineplus .nv-xValue,
-.nvd3.nv-sparklineplus .nv-yValue {
- /*
- stroke: #666;
- */
- stroke-width: 0;
- font-size: .9em;
- font-weight: normal;
-}
-
-.nvd3.nv-sparklineplus .nv-yValue {
- stroke: #f66;
-}
-
-.nvd3.nv-sparklineplus .nv-maxValue {
- stroke: #2ca02c;
- fill: #2ca02c;
-}
-
-.nvd3.nv-sparklineplus .nv-minValue {
- stroke: #d62728;
- fill: #d62728;
-}
-
-.nvd3.nv-sparklineplus .nv-currentValue {
- /*
- stroke: #444;
- fill: #000;
- */
- font-weight: bold;
- font-size: 1.1em;
-}
-
-/**********
-* historical stock
-*/
-
-.nvd3.nv-ohlcBar .nv-ticks .nv-tick {
- stroke-width: 2px;
-}
-
-.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover {
- stroke-width: 4px;
-}
-
-.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive {
- stroke: #2ca02c;
-}
-
-.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative {
- stroke: #d62728;
-}
-
-.nvd3.nv-historicalStockChart .nv-axis .nv-axislabel {
- font-weight: bold;
-}
-
-.nvd3.nv-historicalStockChart .nv-dragTarget {
- fill-opacity: 0;
- stroke: none;
- cursor: move;
-}
-
-.nvd3 .nv-brush .extent {
- /*
- cursor: ew-resize !important;
- */
- fill-opacity: 0 !important;
-}
-
-.nvd3 .nv-brushBackground rect {
- stroke: #000;
- stroke-width: .4;
- fill: #fff;
- fill-opacity: .7;
-}
-
-
-
-/**********
-* Indented Tree
-*/
-
-
-/**
- * TODO: the following 3 selectors are based on classes used in the example. I should either make them standard and leave them here, or move to a CSS file not included in the library
- */
-.nvd3.nv-indentedtree .name {
- margin-left: 5px;
-}
-
-.nvd3.nv-indentedtree .clickable {
- color: #08C;
- cursor: pointer;
-}
-
-.nvd3.nv-indentedtree span.clickable:hover {
- color: #005580;
- text-decoration: underline;
-}
-
-
-.nvd3.nv-indentedtree .nv-childrenCount {
- display: inline-block;
- margin-left: 5px;
-}
-
-.nvd3.nv-indentedtree .nv-treeicon {
- cursor: pointer;
- /*
- cursor: n-resize;
- */
-}
-
-.nvd3.nv-indentedtree .nv-treeicon.nv-folded {
- cursor: pointer;
- /*
- cursor: s-resize;
- */
-}
-
-/**********
-* Parallel Coordinates
-*/
-
-.nvd3 .background path {
- fill: none;
- stroke: #ccc;
- stroke-opacity: .4;
- shape-rendering: crispEdges;
-}
-
-.nvd3 .foreground path {
- fill: none;
- stroke: steelblue;
- stroke-opacity: .7;
-}
-
-.nvd3 .brush .extent {
- fill-opacity: .3;
- stroke: #fff;
- shape-rendering: crispEdges;
-}
-
-.nvd3 .axis line, .axis path {
- fill: none;
- stroke: #000;
- shape-rendering: crispEdges;
-}
-
-.nvd3 .axis text {
- text-shadow: 0 1px 0 #fff;
-}
\ No newline at end of file
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/css/tipsy.css b/modules/enterprise/gui/coregui/src/main/webapp/css/tipsy.css
deleted file mode 100644
index f1f734f..0000000
--- a/modules/enterprise/gui/coregui/src/main/webapp/css/tipsy.css
+++ /dev/null
@@ -1,140 +0,0 @@
-.tipsy {
- font-size: 10px;
- position: absolute;
- padding: 5px;
- z-index: 990000;
-}
-
-.tipsy-inner {
- background-color: #000;
- color: #FFF;
- max-width: 200px;
- padding: 5px 8px 4px 8px;
- text-align: center;
- z-index: 990000;
-}
-
-/* Rounded corners */
-.tipsy-inner {
- border-radius: 3px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- z-index: 990000;
-}
-
-/* Uncomment for shadow */
-/*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/
-
-.tipsy-arrow {
- position: absolute;
- width: 0;
- height: 0;
- line-height: 0;
- border: 5px dashed #000;
- z-index: 990000;
-}
-
-/* Rules to colour arrows */
-.tipsy-arrow-n {
- border-bottom-color: #000;
- z-index: 990000;
-}
-
-.tipsy-arrow-s {
- border-top-color: #000;
- z-index: 990000;
-}
-
-.tipsy-arrow-e {
- border-left-color: #000;
- z-index: 990000;
-}
-
-.tipsy-arrow-w {
- border-right-color: #000;
- z-index: 990000;
-}
-
-.tipsy-n .tipsy-arrow {
- top: 0;
- left: 50%;
- margin-left: -5px;
- border-bottom-style: solid;
- border-top: none;
- border-left-color: transparent;
- border-right-color: transparent;
- z-index: 990000;
-}
-
-.tipsy-nw .tipsy-arrow {
- top: 0;
- left: 10px;
- border-bottom-style: solid;
- border-top: none;
- border-left-color: transparent;
- border-right-color: transparent;
- z-index: 990000;
-}
-
-.tipsy-ne .tipsy-arrow {
- top: 0;
- right: 10px;
- border-bottom-style: solid;
- border-top: none;
- border-left-color: transparent;
- border-right-color: transparent;
- z-index: 990000;
-}
-
-.tipsy-s .tipsy-arrow {
- bottom: 0;
- left: 50%;
- margin-left: -5px;
- border-top-style: solid;
- border-bottom: none;
- border-left-color: transparent;
- border-right-color: transparent;
- z-index: 990000;
-}
-
-.tipsy-sw .tipsy-arrow {
- bottom: 0;
- left: 10px;
- border-top-style: solid;
- border-bottom: none;
- border-left-color: transparent;
- border-right-color: transparent;
- z-index: 990000;
-}
-
-.tipsy-se .tipsy-arrow {
- bottom: 0;
- right: 10px;
- border-top-style: solid;
- border-bottom: none;
- border-left-color: transparent;
- border-right-color: transparent;
- z-index: 990000;
-}
-
-.tipsy-e .tipsy-arrow {
- right: 0;
- top: 50%;
- margin-top: -5px;
- border-left-style: solid;
- border-right: none;
- border-top-color: transparent;
- border-bottom-color: transparent;
- z-index: 990000;
-}
-
-.tipsy-w .tipsy-arrow {
- left: 0;
- top: 50%;
- margin-top: -5px;
- border-right-style: solid;
- border-left: none;
- border-top-color: transparent;
- border-bottom-color: transparent;
- z-index: 990000;
-}
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/js/jquery.tipsy.js b/modules/enterprise/gui/coregui/src/main/webapp/js/jquery.tipsy.js
deleted file mode 100644
index bba968c..0000000
--- a/modules/enterprise/gui/coregui/src/main/webapp/js/jquery.tipsy.js
+++ /dev/null
@@ -1,336 +0,0 @@
-// tipsy, facebook style tooltips for jquery
-// version 1.0.0a
-// (c) 2008-2010 jason frame [jason(a)onehackoranother.com]
-// released under the MIT license
-
-(function($) {
-
- function maybeCall(thing, ctx) {
- return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
- }
-
- // CAUTION the current implementation does not allow for tipsied elements to stay out of DOM (in between events)
- // i.e. don't remove, store, then re-insert tipsied elements (and why would you want to do that anyway?)
- var garbageCollect = (function() {
- var currentInterval;
- var to = null;
- var tipsies = [];
-
- function _do() {
- for (var i = 0; i < tipsies.length;) {
- var t = tipsies[i];
- // FIXME? the 2nd (non-paranoid) check is from the link below, it should be replaced if a better way is found
- // http://stackoverflow.com/questions/4040715/check-if-cached-jquery-object-...
- if (t.options.gcInterval === 0 || t.$element.closest('body').length === 0) {
- t.hoverState = 'out';
- t.hide();
- tipsies.splice(i,1);
- } else {
- i++;
- }
- }
- }
- function _loop() {
- to = setTimeout(function() { _do(); _loop(); }, currentInterval);
- }
-
- return function(t) {
- if (t.options.gcInterval === 0) return;
-
- if (to && t.options.gcInterval < currentInterval) {
- clearTimeout(to); to = null;
- currentInterval = t.options.gcInterval;
- }
- tipsies.push(t);
- if (!to) _loop();
- };
- })();
-
- function Tipsy(element, options) {
- this.$element = $(element);
- this.options = options;
- this.enabled = true;
- this.fixTitle();
- garbageCollect(this);
- }
-
-
- Tipsy.prototype = {
- show: function() {
- var title = this.getTitle();
- if (title && this.enabled) {
- var $tip = this.tip();
-
- $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
- $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
- $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
-
- var pos = $.extend({}, this.$element.offset(), {
- width: this.$element[0].offsetWidth || 0,
- height: this.$element[0].offsetHeight || 0
- });
-
- if (typeof this.$element[0].nearestViewportElement == 'object') {
- // SVG
- var el = this.$element[0];
- var rect = el.getBoundingClientRect();
- pos.width = rect.width;
- pos.height = rect.height;
- }
-
-
- var actualWidth = $tip[0].offsetWidth,
- actualHeight = $tip[0].offsetHeight,
- gravity = maybeCall(this.options.gravity, this.$element[0]);
-
- var tp;
- switch (gravity.charAt(0)) {
- case 'n':
- tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
- break;
- case 's':
- tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
- break;
- case 'e':
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
- break;
- case 'w':
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
- break;
- }
-
- if (gravity.length == 2) {
- if (gravity.charAt(1) == 'w') {
- tp.left = pos.left + pos.width / 2 - 15;
- } else {
- tp.left = pos.left + pos.width / 2 - actualWidth + 15;
- }
- }
-
- $tip.css(tp).addClass('tipsy-' + gravity);
- $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
- if (this.options.className) {
- $tip.addClass(maybeCall(this.options.className, this.$element[0]));
- }
-
- if (this.options.fade) {
- $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
- } else {
- $tip.css({visibility: 'visible', opacity: this.options.opacity});
- }
-
- var t = this;
- var set_hovered = function(set_hover){
- return function(){
- t.$tip.stop();
- t.tipHovered = set_hover;
- if (!set_hover){
- if (t.options.delayOut === 0 && t.options.trigger != 'manual') {
- t.hide();
- } else {
- setTimeout(function() {
- if (t.hoverState == 'out') t.hide(); }, t.options.delayOut);
- }
- }
- };
- };
- $tip.hover(set_hovered(true), set_hovered(false));
- }
- },
-
- hide: function() {
- if (this.options.fade) {
- this.tip().stop().fadeOut(function() { $(this).remove(); });
- } else {
- this.tip().remove();
- }
- },
-
- fixTitle: function() {
- var $e = this.$element;
-
- if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
- $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
- }
- if (typeof $e.context.nearestViewportElement == 'object'){
- if ($e.children('title').length){
- $e.append('<original-title>' + ($e.children('title').text() || '') + '</original-title>')
- .children('title').remove();
- }
- }
- },
-
- getTitle: function() {
-
- var title, $e = this.$element, o = this.options;
- this.fixTitle();
-
- if (typeof o.title == 'string') {
- var title_name = o.title == 'title' ? 'original-title' : o.title;
- if ($e.children(title_name).length){
- title = $e.children(title_name).html();
- } else{
- title = $e.attr(title_name);
- if (typeof title == 'undefined') title = ''
- }
-
- } else if (typeof o.title == 'function') {
- title = o.title.call($e[0]);
- }
- title = ('' + title).replace(/(^\s*|\s*$)/, "");
- return title || o.fallback;
- },
-
- tip: function() {
- if (!this.$tip) {
- this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
- }
- return this.$tip;
- },
-
- validate: function() {
- if (!this.$element[0].parentNode) {
- this.hide();
- this.$element = null;
- this.options = null;
- }
- },
-
- enable: function() { this.enabled = true; },
- disable: function() { this.enabled = false; },
- toggleEnabled: function() { this.enabled = !this.enabled; }
- };
-
- $.fn.tipsy = function(options) {
-
- if (options === true) {
- return this.data('tipsy');
- } else if (typeof options == 'string') {
- $(this).each(function(i,el){
- if ($(el).data('tipsy')) {
- tipsy = $(el).data('tipsy')
- tipsy[options]();
- }
- });
- return this;
- }
-
- options = $.extend({}, $.fn.tipsy.defaults, options);
-
- if (options.hoverlock && options.delayOut === 0) {
- options.delayOut = 100;
- }
-
- function get(ele) {
- var tipsy = $.data(ele, 'tipsy');
- if (!tipsy) {
- tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
- $.data(ele, 'tipsy', tipsy);
- }
- return tipsy;
- }
-
- function enter() {
- var tipsy = get(this);
- tipsy.hoverState = 'in';
- if (options.delayIn === 0) {
- tipsy.show();
- } else {
- tipsy.fixTitle();
- setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
- }
- }
-
- function leave() {
- var tipsy = get(this);
- tipsy.hoverState = 'out';
- if (options.delayOut === 0) {
- tipsy.hide();
- } else {
- var to = function() {
- if (!tipsy.tipHovered || !options.hoverlock){
- if (tipsy.hoverState == 'out') tipsy.hide();
- }
- };
- setTimeout(to, options.delayOut);
- }
- }
-
- if (!options.live) this.each(function() { get(this); });
-
- if (options.trigger != 'manual') {
- var binder = options.live ? 'live' : 'bind',
- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
- eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
- this[binder](eventIn, enter)[binder](eventOut, leave);
- }
-
- return this;
-
- };
-
- $.fn.tipsy.defaults = {
- className: null,
- delayIn: 0,
- delayOut: 0,
- fade: false,
- fallback: '',
- gcInterval: 0,
- gravity: 'n',
- html: false,
- live: false,
- offset: 0,
- opacity: 0.8,
- title: 'title',
- trigger: 'hover',
- hoverlock: false
- };
-
- // Overwrite this method to provide options on a per-element basis.
- // For example, you could store the gravity in a 'tipsy-gravity' attribute:
- // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
- // (remember - do not modify 'options' in place!)
- $.fn.tipsy.elementOptions = function(ele, options) {
- return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
- };
-
- $.fn.tipsy.autoNS = function() {
- return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
- };
-
- $.fn.tipsy.autoWE = function() {
- return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
- };
-
- /**
- * yields a closure of the supplied parameters, producing a function that takes
- * no arguments and is suitable for use as an autogravity function like so:
- *
- * @param margin (int) - distance from the viewable region edge that an
- * element should be before setting its tooltip's gravity to be away
- * from that edge.
- * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
- * if there are no viewable region edges effecting the tooltip's
- * gravity. It will try to vary from this minimally, for example,
- * if 'sw' is preferred and an element is near the right viewable
- * region edge, but not the top edge, it will set the gravity for
- * that element's tooltip to be 'se', preserving the southern
- * component.
- */
- $.fn.tipsy.autoBounds = function(margin, prefer) {
- return function() {
- var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
- boundTop = $(document).scrollTop() + margin,
- boundLeft = $(document).scrollLeft() + margin,
- $this = $(this);
-
- if ($this.offset().top < boundTop) dir.ns = 'n';
- if ($this.offset().left < boundLeft) dir.ew = 'w';
- if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
- if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
-
- return dir.ns + (dir.ew ? dir.ew : '');
- };
- };
-})(jQuery);
-
10 years, 8 months
[rhq] Changes to 'bug/855674'
by lkrejci
New branch 'bug/855674' available with the following commits:
commit 1d42a95908a01c0963fb4eb0da4e9be5aff20bbb
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Thu Aug 29 18:34:45 2013 +0200
[BZ 855674] - Get rid of the dreaded "PageList was passed an empty collection but 'totalSize' was X" exception.
The main part of the fix is just the realization that the "error"
condition for which the exception was thrown is actually no error but can
be triggered by the mere fact that we use READ_COMMITTED isolation level.
The fact that a user can go past the last page of a result is actually also
not an error and can be triggered by for example a massive change in the
available data between the user asking for first and second page.
I think it is better to stop treating all such conditions as errors and
instead provide the user with means of detecting such states.
For that a new method on pagelist was introduced:
PageList.isConsistent(), which calls out to PageControl.isConsistentWith()
that check if the data and total size of the page list are consistent with
the page control.
This in turn is used by the CriteriaQueryRunner to re-attempt the queries
if it finds the inconsistency (which is most possibly caused by the phantom
read due to our transaction isolation level).
10 years, 8 months
[rhq] modules/enterprise
by Thomas Segismont
modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/CassandraIntegrationTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 5d5328ab6026452b0d0a96e505530a117a4b7724
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Aug 29 18:14:09 2013 +0200
CassandraIntegrationTest: use ClusterBuilder#withCredentialsObfuscated method
diff --git a/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/CassandraIntegrationTest.java b/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/CassandraIntegrationTest.java
index 36cabea..07bcedb 100644
--- a/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/CassandraIntegrationTest.java
+++ b/modules/enterprise/server/server-metrics/src/test/java/org/rhq/server/metrics/CassandraIntegrationTest.java
@@ -76,7 +76,7 @@ public class CassandraIntegrationTest {
Cluster cluster = new ClusterBuilder()
.addContactPoints("127.0.0.1", "127.0.0.2")
- .withCredentials(RHQADMIN, RHQADMIN)
+ .withCredentialsObfuscated(RHQADMIN, RHQADMIN_PASSWORD)
.build();
cluster.register(new Host.StateListener() {
10 years, 8 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java | 13 ++++++----
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java | 12 ++++-----
2 files changed, 14 insertions(+), 11 deletions(-)
New commits:
commit 1fd86a037994bf8c151ec10d63afec0435875d37
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Aug 29 11:28:52 2013 -0400
Bug 1001668
rhqctl.bat install --storage removes and re installs existing/installed storage service - windows
On Windows, When executing rhqctl install, don't re-install the service unless it is missing.
diff --git a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
index fb9bceb..a14553b 100644
--- a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
+++ b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/AbstractInstall.java
@@ -59,17 +59,20 @@ public abstract class AbstractInstall extends ControlCommand {
protected final String STORAGE_CONFIG_PROP = "rhqctl.install.storage-config";
- protected void installWindowsService(File workingDir, String batFile, boolean start) throws Exception {
+ protected void installWindowsService(File workingDir, String batFile, boolean replaceExistingService, boolean start)
+ throws Exception {
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(workingDir);
executor.setStreamHandler(new PumpStreamHandler());
org.apache.commons.exec.CommandLine commandLine;
- commandLine = getCommandLine(batFile, "stop");
- executor.execute(commandLine);
+ if (replaceExistingService) {
+ commandLine = getCommandLine(batFile, "stop");
+ executor.execute(commandLine);
- commandLine = getCommandLine(batFile, "remove");
- executor.execute(commandLine);
+ commandLine = getCommandLine(batFile, "remove");
+ executor.execute(commandLine);
+ }
commandLine = getCommandLine(batFile, "install");
executor.execute(commandLine);
diff --git a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
index 0808db2..57e3dad 100644
--- a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
+++ b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
@@ -142,7 +142,7 @@ public class Install extends AbstractInstall {
if (!isStorageInstalled()) {
installStorageNode(getStorageBasedir(), commandLine);
} else if (isWindows()) {
- installWindowsService(getBinDir(), "rhq-storage", true);
+ installWindowsService(getBinDir(), "rhq-storage", false, true);
}
if (!isServerInstalled()) {
@@ -150,7 +150,7 @@ public class Install extends AbstractInstall {
runRHQServerInstaller();
waitForRHQServerToInitialize();
} else if (isWindows()) {
- installWindowsService(getBinDir(), "rhq-server", true);
+ installWindowsService(getBinDir(), "rhq-server", false, true);
}
if (!isAgentInstalled()) {
@@ -166,7 +166,7 @@ public class Install extends AbstractInstall {
}
} else if (isWindows()) {
boolean start = Boolean.parseBoolean(commandLine.getOptionValue(AGENT_AUTOSTART_OPTION, "true"));
- installWindowsService(new File(getAgentBasedir(), "bin"), "rhq-agent-wrapper", start);
+ installWindowsService(new File(getAgentBasedir(), "bin"), "rhq-agent-wrapper", false, start);
}
} else {
@@ -175,7 +175,7 @@ public class Install extends AbstractInstall {
log.info("The RHQ storage node is already installed in " + new File(getBaseDir(), "storage"));
if (isWindows()) {
- installWindowsService(getBinDir(), "rhq-storage", true);
+ installWindowsService(getBinDir(), "rhq-storage", false, true);
} else {
log.info("Skipping storage node installation.");
}
@@ -202,7 +202,7 @@ public class Install extends AbstractInstall {
log.warn("The RHQ server is already installed.");
if (isWindows()) {
- installWindowsService(getBinDir(), "rhq-server", true);
+ installWindowsService(getBinDir(), "rhq-server", false, true);
} else {
log.info("Skipping server installation.");
}
@@ -222,7 +222,7 @@ public class Install extends AbstractInstall {
boolean start = Boolean
.parseBoolean(commandLine.getOptionValue(AGENT_AUTOSTART_OPTION, "true"));
if (isWindows()) {
- installWindowsService(new File(getAgentBasedir(), "bin"), "rhq-agent-wrapper", start);
+ installWindowsService(new File(getAgentBasedir(), "bin"), "rhq-agent-wrapper", false, start);
} else {
log.info("Skipping agent installation.");
}
10 years, 8 months