cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r945845 - in /cassandra/trunk: interface/cassandra.avpr interface/cassandra.genavro src/java/org/apache/cassandra/avro/CassandraServer.java test/system/test_avro_server.py
Date Tue, 18 May 2010 19:44:37 GMT
Author: eevans
Date: Tue May 18 19:44:37 2010
New Revision: 945845

URL: http://svn.apache.org/viewvc?rev=945845&view=rev
Log:
avro implementation of describe_cluster_name()

Patch by eevans

Modified:
    cassandra/trunk/interface/cassandra.avpr
    cassandra/trunk/interface/cassandra.genavro
    cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java
    cassandra/trunk/test/system/test_avro_server.py

Modified: cassandra/trunk/interface/cassandra.avpr
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.avpr?rev=945845&r1=945844&r2=945845&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.avpr (original)
+++ cassandra/trunk/interface/cassandra.avpr Tue May 18 19:44:37 2010
@@ -187,6 +187,11 @@
         "request": [],
         "response": {"type": "array", "items": "string"},
         "errors": []
+    },
+    "describe_cluster_name": {
+        "request": [],
+        "response": "string",
+        "errors": []
     }
   }
 }

Modified: cassandra/trunk/interface/cassandra.genavro
URL: http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.genavro?rev=945845&r1=945844&r2=945845&view=diff
==============================================================================
--- cassandra/trunk/interface/cassandra.genavro (original)
+++ cassandra/trunk/interface/cassandra.genavro Tue May 18 19:44:37 2010
@@ -129,4 +129,6 @@ protocol Cassandra {
     void set_keyspace(string keyspace) throws InvalidRequestException;
 
     array<string> describe_keyspaces();
+
+    string describe_cluster_name();
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java?rev=945845&r1=945844&r2=945845&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/avro/CassandraServer.java Tue May 18 19:44:37
2010
@@ -565,4 +565,10 @@ public class CassandraServer implements 
         
         return avroResults;
     }
+
+    @Override
+    public Utf8 describe_cluster_name() throws AvroRemoteException
+    {
+        return new Utf8(DatabaseDescriptor.getClusterName());
+    }
 }

Modified: cassandra/trunk/test/system/test_avro_server.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_avro_server.py?rev=945845&r1=945844&r2=945845&view=diff
==============================================================================
--- cassandra/trunk/test/system/test_avro_server.py (original)
+++ cassandra/trunk/test/system/test_avro_server.py Tue May 18 19:44:37 2010
@@ -96,6 +96,11 @@ class TestRpcOperations(AvroTester):
         keyspaces = self.client.request('describe_keyspaces', {})
         assert 'Keyspace1' in keyspaces, "Keyspace1 not in " + keyspaces
 
+    def test_describe_cluster_name(self):
+        "retrieving the cluster name"
+        name = self.client.request('describe_cluster_name', {})
+        assert 'Test' in name, "'Test' not in '" + name + "'"
+
     def test_get_api_version(self):
         "getting the remote api version string"
         vers = self.client.request('get_api_version', {})



Mime
View raw message