cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cassandra-dbapi2.apache-extras....@codespot.com
Subject [cassandra-dbapi2] push by john.eri...@gmail.com - Add CQL version support (and thrift files recompile for thrift 7) on 2012-01-28 03:21 GMT
Date Sat, 28 Jan 2012 03:22:20 GMT
Revision: 06c209440e43
Author:   Sylvain Lebresne <sylvain@datastax.com>
Date:     Wed Jan 25 04:36:19 2012
Log:      Add CQL version support (and thrift files recompile for thrift 7)

http://code.google.com/a/apache-extras.org/p/cassandra-dbapi2/source/detail?r=06c209440e43

Modified:
  /cql/__init__.py
  /cql/cassandra/Cassandra.py
  /cql/cassandra/constants.py
  /cql/cassandra/ttypes.py
  /cql/connection.py

=======================================
--- /cql/__init__.py	Fri Nov  4 14:31:47 2011
+++ /cql/__init__.py	Wed Jan 25 04:36:19 2012
@@ -46,8 +46,8 @@
  paramstyle = 'named'

  # TODO: Pull connections out of a pool instead.
-def connect(host, port=9160, keyspace='system', user=None, password=None):
-    return connection.Connection(host, port, keyspace, user, password)
+def connect(host, port=9160, keyspace='system', user=None, password=None,  
cql_version=None):
+    return connection.Connection(host, port, keyspace, user, password,  
cql_version)

  # Module Type Objects and Constructors

=======================================
--- /cql/cassandra/Cassandra.py	Tue Sep  6 09:21:29 2011
+++ /cql/cassandra/Cassandra.py	Wed Jan 25 04:36:19 2012
@@ -1,5 +1,5 @@
-#
-# Autogenerated by Thrift
+#
+# Autogenerated by Thrift Compiler (0.7.0)
  #
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  #
@@ -107,6 +107,7 @@
    def get_indexed_slices(self, column_parent, index_clause,  
column_predicate, consistency_level):
      """
      Returns the subset of columns specified in SlicePredicate for the rows  
matching the IndexClause
+    @Deprecated; use get_range_slices instead with range.row_filter  
specified

      Parameters:
       - column_parent
@@ -338,11 +339,42 @@
      """
      pass

+  def prepare_cql_query(self, query, compression):
+    """
+    Prepare a CQL (Cassandra Query Language) statement by compiling and  
returning
+    - the type of CQL statement
+    - an id token of the compiled CQL stored on the server side.
+    - a count of the discovered bound markers in the statement
+
+    Parameters:
+     - query
+     - compression
+    """
+    pass
+
+  def execute_prepared_cql_query(self, itemId, values):
+    """
+    Executes a prepared CQL (Cassandra Query Language) statement by  
passing an id token and  a list of variables
+    to bind and returns a CqlResult containing the results.
+
+    Parameters:
+     - itemId
+     - values
+    """
+    pass
+
+  def set_cql_version(self, version):
+    """
+    Parameters:
+     - version
+    """
+    pass
+

  class Client(Iface):
    def __init__(self, iprot, oprot=None):
      self._iprot = self._oprot = iprot
-    if oprot != None:
+    if oprot is not None:
        self._oprot = oprot
      self._seqid = 0

@@ -372,9 +404,9 @@
      result = login_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.authnx != None:
+    if result.authnx is not None:
        raise result.authnx
-    if result.authzx != None:
+    if result.authzx is not None:
        raise result.authzx
      return

@@ -404,7 +436,7 @@
      result = set_keyspace_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
      return

@@ -441,15 +473,15 @@
      result = get_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.nfe != None:
+    if result.nfe is not None:
        raise result.nfe
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      raise TApplicationException(TApplicationException.MISSING_RESULT, "get  
failed: unknown result");

@@ -488,13 +520,13 @@
      result = get_slice_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "get_slice  
failed: unknown result");

@@ -533,13 +565,13 @@
      result = get_count_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "get_count  
failed: unknown result");

@@ -577,13 +609,13 @@
      result = multiget_slice_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "multiget_slice  
failed: unknown result");

@@ -621,13 +653,13 @@
      result = multiget_count_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "multiget_count  
failed: unknown result");

@@ -665,19 +697,20 @@
      result = get_range_slices_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "get_range_slices  
failed: unknown result");

    def get_indexed_slices(self, column_parent, index_clause,  
column_predicate, consistency_level):
      """
      Returns the subset of columns specified in SlicePredicate for the rows  
matching the IndexClause
+    @Deprecated; use get_range_slices instead with range.row_filter  
specified

      Parameters:
       - column_parent
@@ -709,13 +742,13 @@
      result = get_indexed_slices_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "get_indexed_slices  
failed: unknown result");

@@ -753,11 +786,11 @@
      result = insert_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      return

@@ -795,11 +828,11 @@
      result = add_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      return

@@ -839,11 +872,11 @@
      result = remove_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      return

@@ -881,11 +914,11 @@
      result = remove_counter_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      return

@@ -922,11 +955,11 @@
      result = batch_mutate_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
      return

@@ -963,10 +996,12 @@
      result = truncate_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
+    if result.te is not None:
+      raise result.te
      return

    def describe_schema_versions(self, ):
@@ -995,9 +1030,9 @@
      result = describe_schema_versions_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "describe_schema_versions  
failed: unknown result");

@@ -1025,9 +1060,9 @@
      result = describe_keyspaces_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "describe_keyspaces  
failed: unknown result");

@@ -1055,7 +1090,7 @@
      result = describe_cluster_name_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "describe_cluster_name  
failed: unknown result");

@@ -1083,7 +1118,7 @@
      result = describe_version_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "describe_version  
failed: unknown result");

@@ -1122,9 +1157,9 @@
      result = describe_ring_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "describe_ring  
failed: unknown result");

@@ -1152,7 +1187,7 @@
      result = describe_partitioner_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "describe_partitioner  
failed: unknown result");

@@ -1180,7 +1215,7 @@
      result = describe_snitch_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "describe_snitch  
failed: unknown result");

@@ -1212,11 +1247,11 @@
      result = describe_keyspace_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.nfe != None:
+    if result.nfe is not None:
        raise result.nfe
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "describe_keyspace  
failed: unknown result");

@@ -1258,9 +1293,9 @@
      result = describe_splits_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "describe_splits  
failed: unknown result");

@@ -1292,11 +1327,11 @@
      result = system_add_column_family_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.sde != None:
+    if result.sde is not None:
        raise result.sde
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "system_add_column_family  
failed: unknown result");

@@ -1328,11 +1363,11 @@
      result = system_drop_column_family_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.sde != None:
+    if result.sde is not None:
        raise result.sde
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "system_drop_column_family  
failed: unknown result");

@@ -1364,11 +1399,11 @@
      result = system_add_keyspace_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.sde != None:
+    if result.sde is not None:
        raise result.sde
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "system_add_keyspace  
failed: unknown result");

@@ -1400,11 +1435,11 @@
      result = system_drop_keyspace_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.sde != None:
+    if result.sde is not None:
        raise result.sde
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "system_drop_keyspace  
failed: unknown result");

@@ -1436,11 +1471,11 @@
      result = system_update_keyspace_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.sde != None:
+    if result.sde is not None:
        raise result.sde
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "system_update_keyspace  
failed: unknown result");

@@ -1472,11 +1507,11 @@
      result = system_update_column_family_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.sde != None:
+    if result.sde is not None:
        raise result.sde
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "system_update_column_family  
failed: unknown result");

@@ -1511,18 +1546,130 @@
      result = execute_cql_query_result()
      result.read(self._iprot)
      self._iprot.readMessageEnd()
-    if result.success != None:
+    if result.success is not None:
        return result.success
-    if result.ire != None:
+    if result.ire is not None:
        raise result.ire
-    if result.ue != None:
+    if result.ue is not None:
        raise result.ue
-    if result.te != None:
+    if result.te is not None:
        raise result.te
-    if result.sde != None:
+    if result.sde is not None:
        raise result.sde
      raise  
TApplicationException(TApplicationException.MISSING_RESULT, "execute_cql_query  
failed: unknown result");

+  def prepare_cql_query(self, query, compression):
+    """
+    Prepare a CQL (Cassandra Query Language) statement by compiling and  
returning
+    - the type of CQL statement
+    - an id token of the compiled CQL stored on the server side.
+    - a count of the discovered bound markers in the statement
+
+    Parameters:
+     - query
+     - compression
+    """
+    self.send_prepare_cql_query(query, compression)
+    return self.recv_prepare_cql_query()
+
+  def send_prepare_cql_query(self, query, compression):
+    self._oprot.writeMessageBegin('prepare_cql_query', TMessageType.CALL,  
self._seqid)
+    args = prepare_cql_query_args()
+    args.query = query
+    args.compression = compression
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_prepare_cql_query(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = prepare_cql_query_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    if result.ire is not None:
+      raise result.ire
+    raise  
TApplicationException(TApplicationException.MISSING_RESULT, "prepare_cql_query  
failed: unknown result");
+
+  def execute_prepared_cql_query(self, itemId, values):
+    """
+    Executes a prepared CQL (Cassandra Query Language) statement by  
passing an id token and  a list of variables
+    to bind and returns a CqlResult containing the results.
+
+    Parameters:
+     - itemId
+     - values
+    """
+    self.send_execute_prepared_cql_query(itemId, values)
+    return self.recv_execute_prepared_cql_query()
+
+  def send_execute_prepared_cql_query(self, itemId, values):
+    self._oprot.writeMessageBegin('execute_prepared_cql_query',  
TMessageType.CALL, self._seqid)
+    args = execute_prepared_cql_query_args()
+    args.itemId = itemId
+    args.values = values
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_execute_prepared_cql_query(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = execute_prepared_cql_query_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.success is not None:
+      return result.success
+    if result.ire is not None:
+      raise result.ire
+    if result.ue is not None:
+      raise result.ue
+    if result.te is not None:
+      raise result.te
+    if result.sde is not None:
+      raise result.sde
+    raise  
TApplicationException(TApplicationException.MISSING_RESULT, "execute_prepared_cql_query  
failed: unknown result");
+
+  def set_cql_version(self, version):
+    """
+    Parameters:
+     - version
+    """
+    self.send_set_cql_version(version)
+    self.recv_set_cql_version()
+
+  def send_set_cql_version(self, version):
+    self._oprot.writeMessageBegin('set_cql_version', TMessageType.CALL,  
self._seqid)
+    args = set_cql_version_args()
+    args.version = version
+    args.write(self._oprot)
+    self._oprot.writeMessageEnd()
+    self._oprot.trans.flush()
+
+  def recv_set_cql_version(self, ):
+    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+    if mtype == TMessageType.EXCEPTION:
+      x = TApplicationException()
+      x.read(self._iprot)
+      self._iprot.readMessageEnd()
+      raise x
+    result = set_cql_version_result()
+    result.read(self._iprot)
+    self._iprot.readMessageEnd()
+    if result.ire is not None:
+      raise result.ire
+    return
+

  class Processor(Iface, TProcessor):
    def __init__(self, handler):
@@ -1559,6 +1706,9 @@
      self._processMap["system_update_keyspace"] =  
Processor.process_system_update_keyspace
      self._processMap["system_update_column_family"] =  
Processor.process_system_update_column_family
      self._processMap["execute_cql_query"] =  
Processor.process_execute_cql_query
+    self._processMap["prepare_cql_query"] =  
Processor.process_prepare_cql_query
+    self._processMap["execute_prepared_cql_query"] =  
Processor.process_execute_prepared_cql_query
+    self._processMap["set_cql_version"] = Processor.process_set_cql_version

    def process(self, iprot, oprot):
      (name, type, seqid) = iprot.readMessageBegin()
@@ -1834,6 +1984,8 @@
        result.ire = ire
      except UnavailableException, ue:
        result.ue = ue
+    except TimedOutException, te:
+      result.te = te
      oprot.writeMessageBegin("truncate", TMessageType.REPLY, seqid)
      result.write(oprot)
      oprot.writeMessageEnd()
@@ -2071,6 +2223,54 @@
      oprot.writeMessageEnd()
      oprot.trans.flush()

+  def process_prepare_cql_query(self, seqid, iprot, oprot):
+    args = prepare_cql_query_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = prepare_cql_query_result()
+    try:
+      result.success = self._handler.prepare_cql_query(args.query,  
args.compression)
+    except InvalidRequestException, ire:
+      result.ire = ire
+    oprot.writeMessageBegin("prepare_cql_query", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_execute_prepared_cql_query(self, seqid, iprot, oprot):
+    args = execute_prepared_cql_query_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = execute_prepared_cql_query_result()
+    try:
+      result.success =  
self._handler.execute_prepared_cql_query(args.itemId, args.values)
+    except InvalidRequestException, ire:
+      result.ire = ire
+    except UnavailableException, ue:
+      result.ue = ue
+    except TimedOutException, te:
+      result.te = te
+    except SchemaDisagreementException, sde:
+      result.sde = sde
+    oprot.writeMessageBegin("execute_prepared_cql_query",  
TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+
+  def process_set_cql_version(self, seqid, iprot, oprot):
+    args = set_cql_version_args()
+    args.read(iprot)
+    iprot.readMessageEnd()
+    result = set_cql_version_result()
+    try:
+      self._handler.set_cql_version(args.version)
+    except InvalidRequestException, ire:
+      result.ire = ire
+    oprot.writeMessageBegin("set_cql_version", TMessageType.REPLY, seqid)
+    result.write(oprot)
+    oprot.writeMessageEnd()
+    oprot.trans.flush()
+

  # HELPER FUNCTIONS AND STRUCTURES

@@ -2113,16 +2313,17 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('login_args')
-    if self.auth_request != None:
+    if self.auth_request is not None:
        oprot.writeFieldBegin('auth_request', TType.STRUCT, 1)
        self.auth_request.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.auth_request is None:
-        raise TProtocol.TProtocolException(message='Required field  
auth_request is unset!')
-      return
+
+  def validate(self):
+    if self.auth_request is None:
+      raise TProtocol.TProtocolException(message='Required field  
auth_request is unset!')
+    return


    def __repr__(self):
@@ -2184,18 +2385,19 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('login_result')
-    if self.authnx != None:
+    if self.authnx is not None:
        oprot.writeFieldBegin('authnx', TType.STRUCT, 1)
        self.authnx.write(oprot)
        oprot.writeFieldEnd()
-    if self.authzx != None:
+    if self.authzx is not None:
        oprot.writeFieldBegin('authzx', TType.STRUCT, 2)
        self.authzx.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __repr__(self):
@@ -2247,16 +2449,17 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('set_keyspace_args')
-    if self.keyspace != None:
+    if self.keyspace is not None:
        oprot.writeFieldBegin('keyspace', TType.STRING, 1)
        oprot.writeString(self.keyspace)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.keyspace is None:
-        raise TProtocol.TProtocolException(message='Required field  
keyspace is unset!')
-      return
+
+  def validate(self):
+    if self.keyspace is None:
+      raise TProtocol.TProtocolException(message='Required field keyspace  
is unset!')
+    return


    def __repr__(self):
@@ -2309,14 +2512,15 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('set_keyspace_result')
-    if self.ire != None:
+    if self.ire is not None:
        oprot.writeFieldBegin('ire', TType.STRUCT, 1)
        self.ire.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __repr__(self):
@@ -2385,28 +2589,29 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('get_args')
-    if self.key != None:
+    if self.key is not None:
        oprot.writeFieldBegin('key', TType.STRING, 1)
        oprot.writeString(self.key)
        oprot.writeFieldEnd()
-    if self.column_path != None:
+    if self.column_path is not None:
        oprot.writeFieldBegin('column_path', TType.STRUCT, 2)
        self.column_path.write(oprot)
        oprot.writeFieldEnd()
-    if self.consistency_level != None:
+    if self.consistency_level is not None:
        oprot.writeFieldBegin('consistency_level', TType.I32, 3)
        oprot.writeI32(self.consistency_level)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.key is None:
-        raise TProtocol.TProtocolException(message='Required field key is  
unset!')
-      if self.column_path is None:
-        raise TProtocol.TProtocolException(message='Required field  
column_path is unset!')
-      if self.consistency_level is None:
-        raise TProtocol.TProtocolException(message='Required field  
consistency_level is unset!')
-      return
+
+  def validate(self):
+    if self.key is None:
+      raise TProtocol.TProtocolException(message='Required field key is  
unset!')
+    if self.column_path is None:
+      raise TProtocol.TProtocolException(message='Required field  
column_path is unset!')
+    if self.consistency_level is None:
+      raise TProtocol.TProtocolException(message='Required field  
consistency_level is unset!')
+    return


    def __repr__(self):
@@ -2494,30 +2699,31 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('get_result')
-    if self.success != None:
+    if self.success is not None:
        oprot.writeFieldBegin('success', TType.STRUCT, 0)
        self.success.write(oprot)
        oprot.writeFieldEnd()
-    if self.ire != None:
+    if self.ire is not None:
        oprot.writeFieldBegin('ire', TType.STRUCT, 1)
        self.ire.write(oprot)
        oprot.writeFieldEnd()
-    if self.nfe != None:
+    if self.nfe is not None:
        oprot.writeFieldBegin('nfe', TType.STRUCT, 2)
        self.nfe.write(oprot)
        oprot.writeFieldEnd()
-    if self.ue != None:
+    if self.ue is not None:
        oprot.writeFieldBegin('ue', TType.STRUCT, 3)
        self.ue.write(oprot)
        oprot.writeFieldEnd()
-    if self.te != None:
+    if self.te is not None:
        oprot.writeFieldBegin('te', TType.STRUCT, 4)
        self.te.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __repr__(self):
@@ -2595,34 +2801,35 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('get_slice_args')
-    if self.key != None:
+    if self.key is not None:
        oprot.writeFieldBegin('key', TType.STRING, 1)
        oprot.writeString(self.key)
        oprot.writeFieldEnd()
-    if self.column_parent != None:
+    if self.column_parent is not None:
        oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
        self.column_parent.write(oprot)
        oprot.writeFieldEnd()
-    if self.predicate != None:
+    if self.predicate is not None:
        oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
        self.predicate.write(oprot)
        oprot.writeFieldEnd()
-    if self.consistency_level != None:
+    if self.consistency_level is not None:
        oprot.writeFieldBegin('consistency_level', TType.I32, 4)
        oprot.writeI32(self.consistency_level)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.key is None:
-        raise TProtocol.TProtocolException(message='Required field key is  
unset!')
-      if self.column_parent is None:
-        raise TProtocol.TProtocolException(message='Required field  
column_parent is unset!')
-      if self.predicate is None:
-        raise TProtocol.TProtocolException(message='Required field  
predicate is unset!')
-      if self.consistency_level is None:
-        raise TProtocol.TProtocolException(message='Required field  
consistency_level is unset!')
-      return
+
+  def validate(self):
+    if self.key is None:
+      raise TProtocol.TProtocolException(message='Required field key is  
unset!')
+    if self.column_parent is None:
+      raise TProtocol.TProtocolException(message='Required field  
column_parent is unset!')
+    if self.predicate is None:
+      raise TProtocol.TProtocolException(message='Required field predicate  
is unset!')
+    if self.consistency_level is None:
+      raise TProtocol.TProtocolException(message='Required field  
consistency_level is unset!')
+    return


    def __repr__(self):
@@ -2670,11 +2877,11 @@
        if fid == 0:
          if ftype == TType.LIST:
            self.success = []
-          (_etype136, _size133) = iprot.readListBegin()
-          for _i137 in xrange(_size133):
-            _elem138 = ColumnOrSuperColumn()
-            _elem138.read(iprot)
-            self.success.append(_elem138)
+          (_etype164, _size161) = iprot.readListBegin()
+          for _i165 in xrange(_size161):
+            _elem166 = ColumnOrSuperColumn()
+            _elem166.read(iprot)
+            self.success.append(_elem166)
            iprot.readListEnd()
          else:
            iprot.skip(ftype)
@@ -2706,29 +2913,30 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('get_slice_result')
-    if self.success != None:
+    if self.success is not None:
        oprot.writeFieldBegin('success', TType.LIST, 0)
        oprot.writeListBegin(TType.STRUCT, len(self.success))
-      for iter139 in self.success:
-        iter139.write(oprot)
+      for iter167 in self.success:
+        iter167.write(oprot)
        oprot.writeListEnd()
        oprot.writeFieldEnd()
-    if self.ire != None:
+    if self.ire is not None:
        oprot.writeFieldBegin('ire', TType.STRUCT, 1)
        self.ire.write(oprot)
        oprot.writeFieldEnd()
-    if self.ue != None:
+    if self.ue is not None:
        oprot.writeFieldBegin('ue', TType.STRUCT, 2)
        self.ue.write(oprot)
        oprot.writeFieldEnd()
-    if self.te != None:
+    if self.te is not None:
        oprot.writeFieldBegin('te', TType.STRUCT, 3)
        self.te.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __repr__(self):
@@ -2806,34 +3014,35 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('get_count_args')
-    if self.key != None:
+    if self.key is not None:
        oprot.writeFieldBegin('key', TType.STRING, 1)
        oprot.writeString(self.key)
        oprot.writeFieldEnd()
-    if self.column_parent != None:
+    if self.column_parent is not None:
        oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
        self.column_parent.write(oprot)
        oprot.writeFieldEnd()
-    if self.predicate != None:
+    if self.predicate is not None:
        oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
        self.predicate.write(oprot)
***The diff for this file has been truncated for email.***
=======================================
--- /cql/cassandra/constants.py	Tue Sep  6 09:21:29 2011
+++ /cql/cassandra/constants.py	Wed Jan 25 04:36:19 2012
@@ -1,5 +1,5 @@
-#
-# Autogenerated by Thrift
+#
+# Autogenerated by Thrift Compiler (0.7.0)
  #
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  #
@@ -7,4 +7,4 @@
  from thrift.Thrift import *
  from ttypes import *

-VERSION = "19.13.0"
+VERSION = "19.26.0"
=======================================
--- /cql/cassandra/ttypes.py	Tue Sep  6 09:21:29 2011
+++ /cql/cassandra/ttypes.py	Wed Jan 25 04:36:19 2012
@@ -1,5 +1,5 @@
-#
-# Autogenerated by Thrift
+#
+# Autogenerated by Thrift Compiler (0.7.0)
  #
  # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  #
@@ -228,28 +228,29 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('Column')
-    if self.name != None:
+    if self.name is not None:
        oprot.writeFieldBegin('name', TType.STRING, 1)
        oprot.writeString(self.name)
        oprot.writeFieldEnd()
-    if self.value != None:
+    if self.value is not None:
        oprot.writeFieldBegin('value', TType.STRING, 2)
        oprot.writeString(self.value)
        oprot.writeFieldEnd()
-    if self.timestamp != None:
+    if self.timestamp is not None:
        oprot.writeFieldBegin('timestamp', TType.I64, 3)
        oprot.writeI64(self.timestamp)
        oprot.writeFieldEnd()
-    if self.ttl != None:
+    if self.ttl is not None:
        oprot.writeFieldBegin('ttl', TType.I32, 4)
        oprot.writeI32(self.ttl)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.name is None:
-        raise TProtocol.TProtocolException(message='Required field name is  
unset!')
-      return
+
+  def validate(self):
+    if self.name is None:
+      raise TProtocol.TProtocolException(message='Required field name is  
unset!')
+    return


    def __repr__(self):
@@ -320,11 +321,11 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('SuperColumn')
-    if self.name != None:
+    if self.name is not None:
        oprot.writeFieldBegin('name', TType.STRING, 1)
        oprot.writeString(self.name)
        oprot.writeFieldEnd()
-    if self.columns != None:
+    if self.columns is not None:
        oprot.writeFieldBegin('columns', TType.LIST, 2)
        oprot.writeListBegin(TType.STRUCT, len(self.columns))
        for iter6 in self.columns:
@@ -333,12 +334,13 @@
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.name is None:
-        raise TProtocol.TProtocolException(message='Required field name is  
unset!')
-      if self.columns is None:
-        raise TProtocol.TProtocolException(message='Required field columns  
is unset!')
-      return
+
+  def validate(self):
+    if self.name is None:
+      raise TProtocol.TProtocolException(message='Required field name is  
unset!')
+    if self.columns is None:
+      raise TProtocol.TProtocolException(message='Required field columns  
is unset!')
+    return


    def __repr__(self):
@@ -398,22 +400,23 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('CounterColumn')
-    if self.name != None:
+    if self.name is not None:
        oprot.writeFieldBegin('name', TType.STRING, 1)
        oprot.writeString(self.name)
        oprot.writeFieldEnd()
-    if self.value != None:
+    if self.value is not None:
        oprot.writeFieldBegin('value', TType.I64, 2)
        oprot.writeI64(self.value)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.name is None:
-        raise TProtocol.TProtocolException(message='Required field name is  
unset!')
-      if self.value is None:
-        raise TProtocol.TProtocolException(message='Required field value  
is unset!')
-      return
+
+  def validate(self):
+    if self.name is None:
+      raise TProtocol.TProtocolException(message='Required field name is  
unset!')
+    if self.value is None:
+      raise TProtocol.TProtocolException(message='Required field value is  
unset!')
+    return


    def __repr__(self):
@@ -479,11 +482,11 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('CounterSuperColumn')
-    if self.name != None:
+    if self.name is not None:
        oprot.writeFieldBegin('name', TType.STRING, 1)
        oprot.writeString(self.name)
        oprot.writeFieldEnd()
-    if self.columns != None:
+    if self.columns is not None:
        oprot.writeFieldBegin('columns', TType.LIST, 2)
        oprot.writeListBegin(TType.STRUCT, len(self.columns))
        for iter13 in self.columns:
@@ -492,12 +495,13 @@
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.name is None:
-        raise TProtocol.TProtocolException(message='Required field name is  
unset!')
-      if self.columns is None:
-        raise TProtocol.TProtocolException(message='Required field columns  
is unset!')
-      return
+
+  def validate(self):
+    if self.name is None:
+      raise TProtocol.TProtocolException(message='Required field name is  
unset!')
+    if self.columns is None:
+      raise TProtocol.TProtocolException(message='Required field columns  
is unset!')
+    return


    def __repr__(self):
@@ -591,26 +595,27 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('ColumnOrSuperColumn')
-    if self.column != None:
+    if self.column is not None:
        oprot.writeFieldBegin('column', TType.STRUCT, 1)
        self.column.write(oprot)
        oprot.writeFieldEnd()
-    if self.super_column != None:
+    if self.super_column is not None:
        oprot.writeFieldBegin('super_column', TType.STRUCT, 2)
        self.super_column.write(oprot)
        oprot.writeFieldEnd()
-    if self.counter_column != None:
+    if self.counter_column is not None:
        oprot.writeFieldBegin('counter_column', TType.STRUCT, 3)
        self.counter_column.write(oprot)
        oprot.writeFieldEnd()
-    if self.counter_super_column != None:
+    if self.counter_super_column is not None:
        oprot.writeFieldBegin('counter_super_column', TType.STRUCT, 4)
        self.counter_super_column.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __repr__(self):
@@ -653,8 +658,9 @@
      oprot.writeStructBegin('NotFoundException')
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __str__(self):
@@ -712,16 +718,17 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('InvalidRequestException')
-    if self.why != None:
+    if self.why is not None:
        oprot.writeFieldBegin('why', TType.STRING, 1)
        oprot.writeString(self.why)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.why is None:
-        raise TProtocol.TProtocolException(message='Required field why is  
unset!')
-      return
+
+  def validate(self):
+    if self.why is None:
+      raise TProtocol.TProtocolException(message='Required field why is  
unset!')
+    return


    def __str__(self):
@@ -767,8 +774,9 @@
      oprot.writeStructBegin('UnavailableException')
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __str__(self):
@@ -814,8 +822,9 @@
      oprot.writeStructBegin('TimedOutException')
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __str__(self):
@@ -872,16 +881,17 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('AuthenticationException')
-    if self.why != None:
+    if self.why is not None:
        oprot.writeFieldBegin('why', TType.STRING, 1)
        oprot.writeString(self.why)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.why is None:
-        raise TProtocol.TProtocolException(message='Required field why is  
unset!')
-      return
+
+  def validate(self):
+    if self.why is None:
+      raise TProtocol.TProtocolException(message='Required field why is  
unset!')
+    return


    def __str__(self):
@@ -938,16 +948,17 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('AuthorizationException')
-    if self.why != None:
+    if self.why is not None:
        oprot.writeFieldBegin('why', TType.STRING, 1)
        oprot.writeString(self.why)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.why is None:
-        raise TProtocol.TProtocolException(message='Required field why is  
unset!')
-      return
+
+  def validate(self):
+    if self.why is None:
+      raise TProtocol.TProtocolException(message='Required field why is  
unset!')
+    return


    def __str__(self):
@@ -993,8 +1004,9 @@
      oprot.writeStructBegin('SchemaDisagreementException')
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __str__(self):
@@ -1064,20 +1076,21 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('ColumnParent')
-    if self.column_family != None:
+    if self.column_family is not None:
        oprot.writeFieldBegin('column_family', TType.STRING, 3)
        oprot.writeString(self.column_family)
        oprot.writeFieldEnd()
-    if self.super_column != None:
+    if self.super_column is not None:
        oprot.writeFieldBegin('super_column', TType.STRING, 4)
        oprot.writeString(self.super_column)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.column_family is None:
-        raise TProtocol.TProtocolException(message='Required field  
column_family is unset!')
-      return
+
+  def validate(self):
+    if self.column_family is None:
+      raise TProtocol.TProtocolException(message='Required field  
column_family is unset!')
+    return


    def __repr__(self):
@@ -1156,24 +1169,25 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('ColumnPath')
-    if self.column_family != None:
+    if self.column_family is not None:
        oprot.writeFieldBegin('column_family', TType.STRING, 3)
        oprot.writeString(self.column_family)
        oprot.writeFieldEnd()
-    if self.super_column != None:
+    if self.super_column is not None:
        oprot.writeFieldBegin('super_column', TType.STRING, 4)
        oprot.writeString(self.super_column)
        oprot.writeFieldEnd()
-    if self.column != None:
+    if self.column is not None:
        oprot.writeFieldBegin('column', TType.STRING, 5)
        oprot.writeString(self.column)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.column_family is None:
-        raise TProtocol.TProtocolException(message='Required field  
column_family is unset!')
-      return
+
+  def validate(self):
+    if self.column_family is None:
+      raise TProtocol.TProtocolException(message='Required field  
column_family is unset!')
+    return


    def __repr__(self):
@@ -1264,34 +1278,35 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('SliceRange')
-    if self.start != None:
+    if self.start is not None:
        oprot.writeFieldBegin('start', TType.STRING, 1)
        oprot.writeString(self.start)
        oprot.writeFieldEnd()
-    if self.finish != None:
+    if self.finish is not None:
        oprot.writeFieldBegin('finish', TType.STRING, 2)
        oprot.writeString(self.finish)
        oprot.writeFieldEnd()
-    if self.reversed != None:
+    if self.reversed is not None:
        oprot.writeFieldBegin('reversed', TType.BOOL, 3)
        oprot.writeBool(self.reversed)
        oprot.writeFieldEnd()
-    if self.count != None:
+    if self.count is not None:
        oprot.writeFieldBegin('count', TType.I32, 4)
        oprot.writeI32(self.count)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.start is None:
-        raise TProtocol.TProtocolException(message='Required field start  
is unset!')
-      if self.finish is None:
-        raise TProtocol.TProtocolException(message='Required field finish  
is unset!')
-      if self.reversed is None:
-        raise TProtocol.TProtocolException(message='Required field  
reversed is unset!')
-      if self.count is None:
-        raise TProtocol.TProtocolException(message='Required field count  
is unset!')
-      return
+
+  def validate(self):
+    if self.start is None:
+      raise TProtocol.TProtocolException(message='Required field start is  
unset!')
+    if self.finish is None:
+      raise TProtocol.TProtocolException(message='Required field finish is  
unset!')
+    if self.reversed is None:
+      raise TProtocol.TProtocolException(message='Required field reversed  
is unset!')
+    if self.count is None:
+      raise TProtocol.TProtocolException(message='Required field count is  
unset!')
+    return


    def __repr__(self):
@@ -1368,21 +1383,22 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('SlicePredicate')
-    if self.column_names != None:
+    if self.column_names is not None:
        oprot.writeFieldBegin('column_names', TType.LIST, 1)
        oprot.writeListBegin(TType.STRING, len(self.column_names))
        for iter20 in self.column_names:
          oprot.writeString(iter20)
        oprot.writeListEnd()
        oprot.writeFieldEnd()
-    if self.slice_range != None:
+    if self.slice_range is not None:
        oprot.writeFieldBegin('slice_range', TType.STRUCT, 2)
        self.slice_range.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __repr__(self):
@@ -1450,28 +1466,29 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('IndexExpression')
-    if self.column_name != None:
+    if self.column_name is not None:
        oprot.writeFieldBegin('column_name', TType.STRING, 1)
        oprot.writeString(self.column_name)
        oprot.writeFieldEnd()
-    if self.op != None:
+    if self.op is not None:
        oprot.writeFieldBegin('op', TType.I32, 2)
        oprot.writeI32(self.op)
        oprot.writeFieldEnd()
-    if self.value != None:
+    if self.value is not None:
        oprot.writeFieldBegin('value', TType.STRING, 3)
        oprot.writeString(self.value)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.column_name is None:
-        raise TProtocol.TProtocolException(message='Required field  
column_name is unset!')
-      if self.op is None:
-        raise TProtocol.TProtocolException(message='Required field op is  
unset!')
-      if self.value is None:
-        raise TProtocol.TProtocolException(message='Required field value  
is unset!')
-      return
+
+  def validate(self):
+    if self.column_name is None:
+      raise TProtocol.TProtocolException(message='Required field  
column_name is unset!')
+    if self.op is None:
+      raise TProtocol.TProtocolException(message='Required field op is  
unset!')
+    if self.value is None:
+      raise TProtocol.TProtocolException(message='Required field value is  
unset!')
+    return


    def __repr__(self):
@@ -1487,6 +1504,8 @@

  class IndexClause:
    """
+  @Deprecated: use a KeyRange with row_filter in get_range_slices instead
+
    Attributes:
     - expressions
     - start_key
@@ -1545,31 +1564,32 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('IndexClause')
-    if self.expressions != None:
+    if self.expressions is not None:
        oprot.writeFieldBegin('expressions', TType.LIST, 1)
        oprot.writeListBegin(TType.STRUCT, len(self.expressions))
        for iter27 in self.expressions:
          iter27.write(oprot)
        oprot.writeListEnd()
        oprot.writeFieldEnd()
-    if self.start_key != None:
+    if self.start_key is not None:
        oprot.writeFieldBegin('start_key', TType.STRING, 2)
        oprot.writeString(self.start_key)
        oprot.writeFieldEnd()
-    if self.count != None:
+    if self.count is not None:
        oprot.writeFieldBegin('count', TType.I32, 3)
        oprot.writeI32(self.count)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.expressions is None:
-        raise TProtocol.TProtocolException(message='Required field  
expressions is unset!')
-      if self.start_key is None:
-        raise TProtocol.TProtocolException(message='Required field  
start_key is unset!')
-      if self.count is None:
-        raise TProtocol.TProtocolException(message='Required field count  
is unset!')
-      return
+
+  def validate(self):
+    if self.expressions is None:
+      raise TProtocol.TProtocolException(message='Required field  
expressions is unset!')
+    if self.start_key is None:
+      raise TProtocol.TProtocolException(message='Required field start_key  
is unset!')
+    if self.count is None:
+      raise TProtocol.TProtocolException(message='Required field count is  
unset!')
+    return


    def __repr__(self):
@@ -1597,6 +1617,7 @@
     - end_key
     - start_token
     - end_token
+   - row_filter
     - count
    """

@@ -1607,13 +1628,15 @@
      (3, TType.STRING, 'start_token', None, None, ), # 3
      (4, TType.STRING, 'end_token', None, None, ), # 4
      (5, TType.I32, 'count', None, 100, ), # 5
+    (6, TType.LIST, 'row_filter', (TType.STRUCT,(IndexExpression,  
IndexExpression.thrift_spec)), None, ), # 6
    )

-  def __init__(self, start_key=None, end_key=None, start_token=None,  
end_token=None, count=thrift_spec[5][4],):
+  def __init__(self, start_key=None, end_key=None, start_token=None,  
end_token=None, row_filter=None, count=thrift_spec[5][4],):
      self.start_key = start_key
      self.end_key = end_key
      self.start_token = start_token
      self.end_token = end_token
+    self.row_filter = row_filter
      self.count = count

    def read(self, iprot):
@@ -1644,6 +1667,17 @@
          if ftype == TType.STRING:
            self.end_token = iprot.readString();
          else:
+          iprot.skip(ftype)
+      elif fid == 6:
+        if ftype == TType.LIST:
+          self.row_filter = []
+          (_etype31, _size28) = iprot.readListBegin()
+          for _i32 in xrange(_size28):
+            _elem33 = IndexExpression()
+            _elem33.read(iprot)
+            self.row_filter.append(_elem33)
+          iprot.readListEnd()
+        else:
            iprot.skip(ftype)
        elif fid == 5:
          if ftype == TType.I32:
@@ -1660,32 +1694,40 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('KeyRange')
-    if self.start_key != None:
+    if self.start_key is not None:
        oprot.writeFieldBegin('start_key', TType.STRING, 1)
        oprot.writeString(self.start_key)
        oprot.writeFieldEnd()
-    if self.end_key != None:
+    if self.end_key is not None:
        oprot.writeFieldBegin('end_key', TType.STRING, 2)
        oprot.writeString(self.end_key)
        oprot.writeFieldEnd()
-    if self.start_token != None:
+    if self.start_token is not None:
        oprot.writeFieldBegin('start_token', TType.STRING, 3)
        oprot.writeString(self.start_token)
        oprot.writeFieldEnd()
-    if self.end_token != None:
+    if self.end_token is not None:
        oprot.writeFieldBegin('end_token', TType.STRING, 4)
        oprot.writeString(self.end_token)
        oprot.writeFieldEnd()
-    if self.count != None:
+    if self.count is not None:
        oprot.writeFieldBegin('count', TType.I32, 5)
        oprot.writeI32(self.count)
+      oprot.writeFieldEnd()
+    if self.row_filter is not None:
+      oprot.writeFieldBegin('row_filter', TType.LIST, 6)
+      oprot.writeListBegin(TType.STRUCT, len(self.row_filter))
+      for iter34 in self.row_filter:
+        iter34.write(oprot)
+      oprot.writeListEnd()
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.count is None:
-        raise TProtocol.TProtocolException(message='Required field count  
is unset!')
-      return
+
+  def validate(self):
+    if self.count is None:
+      raise TProtocol.TProtocolException(message='Required field count is  
unset!')
+    return


    def __repr__(self):
@@ -1739,11 +1781,11 @@
        elif fid == 2:
          if ftype == TType.LIST:
            self.columns = []
-          (_etype31, _size28) = iprot.readListBegin()
-          for _i32 in xrange(_size28):
-            _elem33 = ColumnOrSuperColumn()
-            _elem33.read(iprot)
-            self.columns.append(_elem33)
+          (_etype38, _size35) = iprot.readListBegin()
+          for _i39 in xrange(_size35):
+            _elem40 = ColumnOrSuperColumn()
+            _elem40.read(iprot)
+            self.columns.append(_elem40)
            iprot.readListEnd()
          else:
            iprot.skip(ftype)
@@ -1757,25 +1799,26 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('KeySlice')
-    if self.key != None:
+    if self.key is not None:
        oprot.writeFieldBegin('key', TType.STRING, 1)
        oprot.writeString(self.key)
        oprot.writeFieldEnd()
-    if self.columns != None:
+    if self.columns is not None:
        oprot.writeFieldBegin('columns', TType.LIST, 2)
        oprot.writeListBegin(TType.STRUCT, len(self.columns))
-      for iter34 in self.columns:
-        iter34.write(oprot)
+      for iter41 in self.columns:
+        iter41.write(oprot)
        oprot.writeListEnd()
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.key is None:
-        raise TProtocol.TProtocolException(message='Required field key is  
unset!')
-      if self.columns is None:
-        raise TProtocol.TProtocolException(message='Required field columns  
is unset!')
-      return
+
+  def validate(self):
+    if self.key is None:
+      raise TProtocol.TProtocolException(message='Required field key is  
unset!')
+    if self.columns is None:
+      raise TProtocol.TProtocolException(message='Required field columns  
is unset!')
+    return


    def __repr__(self):
@@ -1835,22 +1878,23 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('KeyCount')
-    if self.key != None:
+    if self.key is not None:
        oprot.writeFieldBegin('key', TType.STRING, 1)
        oprot.writeString(self.key)
        oprot.writeFieldEnd()
-    if self.count != None:
+    if self.count is not None:
        oprot.writeFieldBegin('count', TType.I32, 2)
        oprot.writeI32(self.count)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.key is None:
-        raise TProtocol.TProtocolException(message='Required field key is  
unset!')
-      if self.count is None:
-        raise TProtocol.TProtocolException(message='Required field count  
is unset!')
-      return
+
+  def validate(self):
+    if self.key is None:
+      raise TProtocol.TProtocolException(message='Required field key is  
unset!')
+    if self.count is None:
+      raise TProtocol.TProtocolException(message='Required field count is  
unset!')
+    return


    def __repr__(self):
@@ -1921,22 +1965,23 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('Deletion')
-    if self.timestamp != None:
+    if self.timestamp is not None:
        oprot.writeFieldBegin('timestamp', TType.I64, 1)
        oprot.writeI64(self.timestamp)
        oprot.writeFieldEnd()
-    if self.super_column != None:
+    if self.super_column is not None:
        oprot.writeFieldBegin('super_column', TType.STRING, 2)
        oprot.writeString(self.super_column)
        oprot.writeFieldEnd()
-    if self.predicate != None:
+    if self.predicate is not None:
        oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
        self.predicate.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      return
+
+  def validate(self):
+    return


    def __repr__(self):
@@ -2002,18 +2047,103 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('Mutation')
-    if self.column_or_supercolumn != None:
+    if self.column_or_supercolumn is not None:
        oprot.writeFieldBegin('column_or_supercolumn', TType.STRUCT, 1)
        self.column_or_supercolumn.write(oprot)
        oprot.writeFieldEnd()
-    if self.deletion != None:
+    if self.deletion is not None:
        oprot.writeFieldBegin('deletion', TType.STRUCT, 2)
        self.deletion.write(oprot)
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
+
+  def validate(self):
+    return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ ==  
other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class EndpointDetails:
+  """
+  Attributes:
+   - host
+   - datacenter
+   - rack
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'host', None, None, ), # 1
+    (2, TType.STRING, 'datacenter', None, None, ), # 2
+    (3, TType.STRING, 'rack', None, None, ), # 3
+  )
+
+  def __init__(self, host=None, datacenter=None, rack=None,):
+    self.host = host
+    self.datacenter = datacenter
+    self.rack = rack
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and  
isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec  
is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__,  
self.thrift_spec))
        return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.host = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.datacenter = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.rack = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and  
self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
+      return
+    oprot.writeStructBegin('EndpointDetails')
+    if self.host is not None:
+      oprot.writeFieldBegin('host', TType.STRING, 1)
+      oprot.writeString(self.host)
+      oprot.writeFieldEnd()
+    if self.datacenter is not None:
+      oprot.writeFieldBegin('datacenter', TType.STRING, 2)
+      oprot.writeString(self.datacenter)
+      oprot.writeFieldEnd()
+    if self.rack is not None:
+      oprot.writeFieldBegin('rack', TType.STRING, 3)
+      oprot.writeString(self.rack)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    return


    def __repr__(self):
@@ -2029,10 +2159,19 @@

  class TokenRange:
    """
+  A TokenRange describes part of the Cassandra ring, it is a mapping from  
a range to
+  endpoints responsible for that range.
+  @param start_token The first token in the range
+  @param end_token The last token in the range
+  @param endpoints The endpoints responsible for the range (listed by  
their configured listen_address)
+  @param rpc_endpoints The endpoints responsible for the range (listed by  
their configured rpc_address)
+
    Attributes:
     - start_token
     - end_token
     - endpoints
+   - rpc_endpoints
+   - endpoint_details
    """

    thrift_spec = (
@@ -2040,12 +2179,16 @@
      (1, TType.STRING, 'start_token', None, None, ), # 1
      (2, TType.STRING, 'end_token', None, None, ), # 2
      (3, TType.LIST, 'endpoints', (TType.STRING,None), None, ), # 3
+    (4, TType.LIST, 'rpc_endpoints', (TType.STRING,None), None, ), # 4
+    (5, TType.LIST, 'endpoint_details', (TType.STRUCT,(EndpointDetails,  
EndpointDetails.thrift_spec)), None, ), # 5
    )

-  def __init__(self, start_token=None, end_token=None, endpoints=None,):
+  def __init__(self, start_token=None, end_token=None, endpoints=None,  
rpc_endpoints=None, endpoint_details=None,):
      self.start_token = start_token
      self.end_token = end_token
      self.endpoints = endpoints
+    self.rpc_endpoints = rpc_endpoints
+    self.endpoint_details = endpoint_details

    def read(self, iprot):
      if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and  
isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec  
is not None and fastbinary is not None:
@@ -2069,12 +2212,33 @@
        elif fid == 3:
          if ftype == TType.LIST:
            self.endpoints = []
-          (_etype38, _size35) = iprot.readListBegin()
-          for _i39 in xrange(_size35):
-            _elem40 = iprot.readString();
-            self.endpoints.append(_elem40)
+          (_etype45, _size42) = iprot.readListBegin()
+          for _i46 in xrange(_size42):
+            _elem47 = iprot.readString();
+            self.endpoints.append(_elem47)
            iprot.readListEnd()
          else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.LIST:
+          self.rpc_endpoints = []
+          (_etype51, _size48) = iprot.readListBegin()
+          for _i52 in xrange(_size48):
+            _elem53 = iprot.readString();
+            self.rpc_endpoints.append(_elem53)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.LIST:
+          self.endpoint_details = []
+          (_etype57, _size54) = iprot.readListBegin()
+          for _i58 in xrange(_size54):
+            _elem59 = EndpointDetails()
+            _elem59.read(iprot)
+            self.endpoint_details.append(_elem59)
+          iprot.readListEnd()
+        else:
            iprot.skip(ftype)
        else:
          iprot.skip(ftype)
@@ -2086,31 +2250,46 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
        return
      oprot.writeStructBegin('TokenRange')
-    if self.start_token != None:
+    if self.start_token is not None:
        oprot.writeFieldBegin('start_token', TType.STRING, 1)
        oprot.writeString(self.start_token)
        oprot.writeFieldEnd()
-    if self.end_token != None:
+    if self.end_token is not None:
        oprot.writeFieldBegin('end_token', TType.STRING, 2)
        oprot.writeString(self.end_token)
        oprot.writeFieldEnd()
-    if self.endpoints != None:
+    if self.endpoints is not None:
        oprot.writeFieldBegin('endpoints', TType.LIST, 3)
        oprot.writeListBegin(TType.STRING, len(self.endpoints))
-      for iter41 in self.endpoints:
-        oprot.writeString(iter41)
+      for iter60 in self.endpoints:
+        oprot.writeString(iter60)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.rpc_endpoints is not None:
+      oprot.writeFieldBegin('rpc_endpoints', TType.LIST, 4)
+      oprot.writeListBegin(TType.STRING, len(self.rpc_endpoints))
+      for iter61 in self.rpc_endpoints:
+        oprot.writeString(iter61)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.endpoint_details is not None:
+      oprot.writeFieldBegin('endpoint_details', TType.LIST, 5)
+      oprot.writeListBegin(TType.STRUCT, len(self.endpoint_details))
+      for iter62 in self.endpoint_details:
+        iter62.write(oprot)
        oprot.writeListEnd()
        oprot.writeFieldEnd()
      oprot.writeFieldStop()
      oprot.writeStructEnd()
-    def validate(self):
-      if self.start_token is None:
-        raise TProtocol.TProtocolException(message='Required field  
start_token is unset!')
-      if self.end_token is None:
-        raise TProtocol.TProtocolException(message='Required field  
end_token is unset!')
-      if self.endpoints is None:
-        raise TProtocol.TProtocolException(message='Required field  
endpoints is unset!')
-      return
+
+  def validate(self):
+    if self.start_token is None:
+      raise TProtocol.TProtocolException(message='Required field  
start_token is unset!')
+    if self.end_token is None:
+      raise TProtocol.TProtocolException(message='Required field end_token  
is unset!')
+    if self.endpoints is None:
+      raise TProtocol.TProtocolException(message='Required field endpoints  
is unset!')
+    return


    def __repr__(self):
@@ -2152,11 +2331,11 @@
        if fid == 1:
          if ftype == TType.MAP:
            self.credentials = {}
-          (_ktype43, _vtype44, _size42 ) = iprot.readMapBegin()
-          for _i46 in xrange(_size42):
-            _key47 = iprot.readString();
-            _val48 = iprot.readString();
-            self.credentials[_key47] = _val48
+          (_ktype64, _vtype65, _size63 ) = iprot.readMapBegin()
+          for _i67 in xrange(_size63):
+            _key68 = iprot.readString();
+            _val69 = iprot.readString();
+            self.credentials[_key68] = _val69
            iprot.readMapEnd()
          else:
            iprot.skip(ftype)
@@ -2170,20 +2349,21 @@
        oprot.trans.write(fastbinary.encode_binary(self, (self.__class__,  
self.thrift_spec)))
***The diff for this file has been truncated for email.***
=======================================
--- /cql/connection.py	Fri Nov  4 14:31:47 2011
+++ /cql/connection.py	Wed Jan 25 04:36:19 2012
@@ -23,7 +23,7 @@


  class Connection(object):
-    def __init__(self, host, port, keyspace, user=None, password=None):
+    def __init__(self, host, port, keyspace, user=None, password=None,  
cql_version=None):
          """
          Params:
          * host .........: hostname of Cassandra node.
@@ -31,6 +31,7 @@
          * keyspace .....: keyspace to connect to.
          * user .........: username used in authentication (optional).
          * password .....: password used in authentication (optional).
+        * cql_version...: CQL version to use (optional).
          """
          self.host = host
          self.port = port
@@ -48,6 +49,9 @@
              credentials = {"username": user, "password": password}
               
self.client.login(AuthenticationRequest(credentials=credentials))

+        if cql_version:
+            self.client.set_cql_version(cql_version)
+
          if keyspace:
              c = self.cursor()
              c.execute('USE %s;' % keyspace)

Mime
View raw message