modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
| 26 ++++++----
modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
| 3 -
modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java
| 15 +++++
modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/util/KeyspaceService.java
| 16 +++++-
modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml
| 2
5 files changed, 50 insertions(+), 12 deletions(-)
New commits:
commit 07f7837556269f38b4095ecfa6a6142357a86522
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Jun 27 07:57:19 2013 -0400
adding repair primary range operation
We will execute primary range repair on on each storage node as part of
regularly scheduled maintenance when we have a multi-node cluster.
diff --git
a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java
b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java
index 81a9388..2155459 100644
---
a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java
+++
b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/KeyspaceComponent.java
@@ -130,6 +130,8 @@ public class KeyspaceComponent implements
ResourceComponent<ResourceComponent<?>
public OperationResult invokeOperation(String name, Configuration parameters) throws
Exception {
if (name.equals("repair")) {
return repairKeyspace();
+ } else if (name.equals("repairPrimaryRange")) {
+ return repairPrimaryRange();
} else if (name.equals("compact")) {
return compactKeyspace();
} else if (name.equals("takeSnapshot")) {
@@ -161,6 +163,19 @@ public class KeyspaceComponent implements
ResourceComponent<ResourceComponent<?>
return new OperationResult();
}
+ public OperationResult repairPrimaryRange() {
+ KeyspaceService keyspaceService = new KeyspaceService(getEmsConnection());
+ String keyspace = context.getResourceKey();
+
+ log.info("Executing primary range repair on keyspace [" + keyspace +
"]");
+ long start = System.currentTimeMillis();
+ keyspaceService.repairPrimaryRange(keyspace);
+ long end = System.currentTimeMillis();
+ log.info("Finished primary range repair on keyspace [" + keyspace +
" in (" + (end - start) + " ms");
+
+ return new OperationResult();
+ }
+
public OperationResult cleanup() {
KeyspaceService keyspaceService = new KeyspaceService(getEmsConnection());
String keyspace = context.getResourceKey();
diff --git a/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml
index 43eb9b2..ebaef94 100644
--- a/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml
@@ -661,6 +661,8 @@
deletes, it is important to run regularly scheduled repairs to ensure
that deleted data gets purged.
The frequency that this should be run should be less than the
gc_grace_period for each column family.
This runs a repair on all column families in this keyspace."
/>
+ <operation name="repairPrimaryRange" description="Runs repair
over all column families but only for the node's
+ primary range."/>
<operation name="cleanup" displayName="Clean Keyspace"
description="Goes through each SSTable file on disk fore each
column family and removes keys
(i.e., rows) that the node does not own. This should be performed as a
routine maintenance task on
commit afa2b682afc073bc8d572694ea986e0610bfec03
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Jun 20 16:49:15 2013 -0400
log a warning when start command is executed and nothing is installed
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
index 93f6a37..7e83c9e 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
@@ -71,14 +71,22 @@ public class Start extends ControlCommand {
try {
// if no options specified, then start whatever is installed
if (commandLine.getOptions().length == 0) {
- if (isStorageInstalled()) {
- startStorage();
- }
- if (isServerInstalled()) {
- startRHQServer();
- }
- if (isAgentInstalled()) {
- startAgent();
+ boolean storageInstalled = isStorageInstalled();
+ boolean serverInstalled = isServerInstalled();
+ boolean agentInstalled = isAgentInstalled();
+
+ if (!(storageInstalled || serverInstalled || agentInstalled)) {
+ log.warn("Nothing to start. No RHQ services are
installed.");
+ } else {
+ if (storageInstalled) {
+ startStorage();
+ }
+ if (serverInstalled) {
+ startRHQServer();
+ }
+ if (agentInstalled) {
+ startAgent();
+ }
}
} else {
if (commandLine.hasOption(STORAGE_OPTION)) {
@@ -107,7 +115,7 @@ public class Start extends ControlCommand {
}
}
} catch (Exception e) {
- throw new RHQControlException("Failed to stop services", e);
+ throw new RHQControlException("Failed to start services", e);
}
}
commit a4a1d4950b9545db9376946131a79afeebc93415
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Jun 20 16:25:14 2013 -0400
repair operation cannot be sequential due to CASSANDRA-5512
Setting the sequential flag causes repoair to be performed off a snapshot which
I am not sure we want to do regardless of this bug.
diff --git
a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
index a73d343..7d06cb2 100644
---
a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
+++
b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
@@ -121,8 +121,9 @@ public class CassandraNodeComponent extends
JMXServerComponent<ResourceComponent
@Override
public void stop() {
- log.info("Shutting down");
+ log.info("Shutting down Cassandra client");
cassandraSession.getCluster().shutdown();
+ log.info("Shutdown is complete");
}
@Override
diff --git
a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/util/KeyspaceService.java
b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/util/KeyspaceService.java
index 5dda8be..76b5b38 100644
---
a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/util/KeyspaceService.java
+++
b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/util/KeyspaceService.java
@@ -59,7 +59,13 @@ public class KeyspaceService {
EmsOperation operation = emsBean.getOperation(REPAIR_OPERATION, String.class,
boolean.class,
boolean.class, String[].class);
- operation.invoke(keyspace, true, true, columnFamilies);
+ // The isSequential param has to be false; otherwise, repair will fail as a
result
+ // of
https://issues.apache.org/jira/browse/CASSANDRA-5512.
+ boolean isSequential = false; // perform sequential repair using snapshot
+
+ boolean isLocal = true; // local to data center
+
+ operation.invoke(keyspace, isSequential, isLocal, columnFamilies);
}
public void repairPrimaryRange(String keyspace, String... columnFamilies) {
@@ -67,7 +73,13 @@ public class KeyspaceService {
EmsOperation operation = emsBean.getOperation(REPAIR_PRIMARY_RANGE, String.class,
boolean.class, boolean.class,
String[].class);
- operation.invoke(keyspace, true, true, columnFamilies);
+ // The isSequential param has to be false; otherwise, repair will fail as a
result
+ // of
https://issues.apache.org/jira/browse/CASSANDRA-5512.
+ boolean isSequential = false; // perform sequential repair using snapshot
+
+ boolean isLocal = true; // local to data center
+
+ operation.invoke(keyspace, isSequential, isLocal, columnFamilies);
}
public void cleanup(String keyspace) {