describe_schema_versions() from Pelops

17 views
Skip to first unread message

Kaz

unread,
Apr 29, 2013, 8:12:11 PM4/29/13
to sca...@googlegroups.com
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.
Can you integrate it into the master branch ?
-Kaz


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);
+    }
+
 }

Reply all
Reply to author
Forward
0 new messages