I'd like to use describe_schema_versions() to address the schema disagreement issue described at:
But Pelops does not have such capability, so I added it to ClusterManager as follows.
diff --git a/src/main/java/org/scale7/cassandra/pelops/ClusterManager.java b/src/main/java/org/scale7/cassandra/pelops/ClusterManager.java
index d928771..83d6dcd 100644
--- a/src/main/java/org/scale7/cassandra/pelops/ClusterManager.java
+++ b/src/main/java/org/scale7/cassandra/pelops/ClusterManager.java
@@ -24,6 +24,9 @@
package org.scale7.cassandra.pelops;
+import java.util.List;
+import java.util.Map;
+
import org.apache.cassandra.thrift.Cassandra.Client;
public class ClusterManager extends ManagerOperand {
@@ -62,4 +65,19 @@ public class ClusterManager extends ManagerOperand {
return tryOperation(operation);
}
+ /**
+ * Get the schema versions of the Cassandra software being run by the cluster.
+ * @return The schema versions of the Cassandra software
+ * @throws Exception
+ */
+ public Map<String,List<String>> getSchemaVersions() throws Exception {
+ IManagerOperation<Map<String,List<String>>> operation = new IManagerOperation<Map<String,List<String>>>() {
+ @Override
+ public Map<String,List<String>> execute(Client conn) throws Exception {
+ return conn.describe_schema_versions();
+ }
+ };
+ return tryOperation(operation);
+ }
+
}