You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2010/02/08 16:57:47 UTC
svn commit: r907705 [1/5] - in /incubator/cassandra/trunk: ./ interface/
interface/thrift/gen-java/org/apache/cassandra/thrift/
interface/thrift/gen-py/ interface/thrift/gen-py/cassandra/
src/java/org/apache/cassandra/service/ src/java/org/apache/cassa...
Author: jbellis
Date: Mon Feb 8 15:57:45 2010
New Revision: 907705
URL: http://svn.apache.org/viewvc?rev=907705&view=rev
Log:
expose describe_ methods replacing the get_*_property ones. add TokenRange struct for describe_ring.
patch by jbellis; reviewed by Stu Hood for CASSANDRA-736
Added:
incubator/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/TokenRange.java (with props)
incubator/cassandra/trunk/interface/thrift/gen-py/
incubator/cassandra/trunk/interface/thrift/gen-py/__init__.py (with props)
incubator/cassandra/trunk/interface/thrift/gen-py/cassandra/
incubator/cassandra/trunk/interface/thrift/gen-py/cassandra/Cassandra-remote
incubator/cassandra/trunk/interface/thrift/gen-py/cassandra/Cassandra.py (with props)
incubator/cassandra/trunk/interface/thrift/gen-py/cassandra/__init__.py (with props)
incubator/cassandra/trunk/interface/thrift/gen-py/cassandra/constants.py (with props)
incubator/cassandra/trunk/interface/thrift/gen-py/cassandra/ttypes.py (with props)
Modified:
incubator/cassandra/trunk/CHANGES.txt
incubator/cassandra/trunk/interface/cassandra.thrift
incubator/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java
incubator/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
incubator/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Constants.java
incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
incubator/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
incubator/cassandra/trunk/test/system/__init__.py
incubator/cassandra/trunk/test/system/test_server.py
Modified: incubator/cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/CHANGES.txt?rev=907705&r1=907704&r2=907705&view=diff
==============================================================================
--- incubator/cassandra/trunk/CHANGES.txt (original)
+++ incubator/cassandra/trunk/CHANGES.txt Mon Feb 8 15:57:45 2010
@@ -21,6 +21,8 @@
* support get_range_slice for RandomPartitioner (CASSANDRA-745)
* per-keyspace replication factory and replication strategy (CASSANDRA-620)
* track latency in microseconds (CASSANDRA-733)
+ * add describe_ Thrift methods, deprecating get_string_property and
+ get_string_list_property
0.5.1
Modified: incubator/cassandra/trunk/interface/cassandra.thrift
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/interface/cassandra.thrift?rev=907705&r1=907704&r2=907705&view=diff
==============================================================================
--- incubator/cassandra/trunk/interface/cassandra.thrift (original)
+++ incubator/cassandra/trunk/interface/cassandra.thrift Mon Feb 8 15:57:45 2010
@@ -46,7 +46,7 @@
# for every edit that doesn't result in a change to major/minor.
#
# See the Semantic Versioning Specification (SemVer) http://semver.org.
-const string VERSION = "2.0.0"
+const string VERSION = "2.1.0"
#
# data structures
@@ -257,14 +257,20 @@
2: optional Deletion deletion,
}
+struct TokenRange {
+ 1: required string start_token,
+ 2: required string end_token,
+ 3: required list<string> endpoints,
+}
+
/**
Authentication requests can contain any data, dependent on the AuthenticationBackend used
*/
-
struct AuthenticationRequest {
1: required map<string, string> credentials,
}
+
service Cassandra {
# auth methods
void login(1: required string keyspace, 2:required AuthenticationRequest auth_request) throws (1:AuthenticationException authnx, 2:AuthorizationException authzx),
@@ -381,14 +387,31 @@
// Meta-APIs -- APIs to get information about the node or cluster,
// rather than user data. The nodeprobe program provides usage examples.
- /** get property whose value is of type string. */
+ /** get property whose value is of type string. @Deprecated */
string get_string_property(1:required string property),
- /** get property whose value is list of strings. */
+ /** get property whose value is list of strings. @Deprecated */
list<string> get_string_list_property(1:required string property),
+ /** list the defined keyspaces in this cluster */
+ set<string> describe_keyspaces(),
+
+ /** get the cluster name */
+ string describe_cluster_name(),
+
+ /** get the thrift api version */
+ string describe_version(),
+
+ /** get the token ring: a map of ranges to host addresses,
+ represented as a set of TokenRange instead of a map from range
+ to list of endpoints, because you can't use Thrift structs as
+ map keys:
+ https://issues.apache.org/jira/browse/THRIFT-162
+ for the same reason, we can't return a set here, even though
+ order is neither important nor predictable. */
+ list<TokenRange> describe_ring(1:required string keyspace),
+
/** describe specified keyspace */
map<string, map<string, string>> describe_keyspace(1:required string keyspace)
throws (1:NotFoundException nfe),
}
-
Modified: incubator/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java?rev=907705&r1=907704&r2=907705&view=diff
==============================================================================
--- incubator/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java (original)
+++ incubator/cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/AuthenticationRequest.java Mon Feb 8 15:57:45 2010
@@ -266,15 +266,15 @@
case CREDENTIALS:
if (field.type == TType.MAP) {
{
- TMap _map12 = iprot.readMapBegin();
- this.credentials = new HashMap<String,String>(2*_map12.size);
- for (int _i13 = 0; _i13 < _map12.size; ++_i13)
+ TMap _map16 = iprot.readMapBegin();
+ this.credentials = new HashMap<String,String>(2*_map16.size);
+ for (int _i17 = 0; _i17 < _map16.size; ++_i17)
{
- String _key14;
- String _val15;
- _key14 = iprot.readString();
- _val15 = iprot.readString();
- this.credentials.put(_key14, _val15);
+ String _key18;
+ String _val19;
+ _key18 = iprot.readString();
+ _val19 = iprot.readString();
+ this.credentials.put(_key18, _val19);
}
iprot.readMapEnd();
}
@@ -300,10 +300,10 @@
oprot.writeFieldBegin(CREDENTIALS_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.credentials.size()));
- for (Map.Entry<String, String> _iter16 : this.credentials.entrySet())
+ for (Map.Entry<String, String> _iter20 : this.credentials.entrySet())
{
- oprot.writeString(_iter16.getKey());
- oprot.writeString(_iter16.getValue());
+ oprot.writeString(_iter20.getKey());
+ oprot.writeString(_iter20.getValue());
}
oprot.writeMapEnd();
}