cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r768382 [1/3] - in /incubator/cassandra/trunk: interface/ lib/ src/org/apache/cassandra/cli/ src/org/apache/cassandra/cql/driver/ src/org/apache/cassandra/service/
Date Fri, 24 Apr 2009 17:52:25 GMT
Author: jbellis
Date: Fri Apr 24 17:52:25 2009
New Revision: 768382

URL: http://svn.apache.org/viewvc?rev=768382&view=rev
Log:
return empty lists instead of raising an error where applicable; otherwise, use
NotFoundError instead of CassandraException.  rely on THRIFT-378 to report internal errors.
also, add field numbers to work around thrift bug generating python code.
patch by jbellis; reviewed by Jun Rao for #66

Removed:
    incubator/cassandra/trunk/src/org/apache/cassandra/service/CassandraException.java
Modified:
    incubator/cassandra/trunk/interface/cassandra.thrift
    incubator/cassandra/trunk/lib/libthrift.jar
    incubator/cassandra/trunk/src/org/apache/cassandra/cli/CliClient.java
    incubator/cassandra/trunk/src/org/apache/cassandra/cql/driver/CqlDriver.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/Cassandra.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/CassandraServer.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/CqlResult_t.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/InvalidRequestException.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/NotFoundException.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/batch_mutation_super_t.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/batch_mutation_t.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/column_t.java
    incubator/cassandra/trunk/src/org/apache/cassandra/service/superColumn_t.java

Modified: incubator/cassandra/trunk/interface/cassandra.thrift
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/interface/cassandra.thrift?rev=768382&r1=768381&r2=768382&view=diff
==============================================================================
--- incubator/cassandra/trunk/interface/cassandra.thrift (original)
+++ incubator/cassandra/trunk/interface/cassandra.thrift Fri Apr 24 17:52:25 2009
@@ -64,57 +64,55 @@
     1: string why
 }
 
-# internal server error
-exception CassandraException {
-    1: string why
-}
-
 
 #
 # service api
 #
 
 service Cassandra {
-  list<column_t> get_slice(string tablename,string key,string columnFamily_column,
i32 start = -1 , i32 count = -1) 
-  throws (1: InvalidRequestException ire, 2: NotFoundException nfe, 3: CassandraException
ce),
+  list<column_t> get_slice(1:string tablename, 2:string key, 3:string columnFamily_column,
4:i32 start=-1, 5:i32 count=-1)
+  throws (1: InvalidRequestException ire, 2: NotFoundException nfe),
   
-  list<column_t> get_slice_by_names(string tablename,string key,string columnFamily,
list<string> columnNames) 
-  throws (1: InvalidRequestException ire, 2: NotFoundException nfe, 3: CassandraException
ce),
+  list<column_t> get_slice_by_names(1:string tablename, 2:string key, 3:string columnFamily,
4:list<string> columnNames)
+  throws (1: InvalidRequestException ire, 2: NotFoundException nfe),
   
-  column_t       get_column(string tablename,string key,string columnFamily_column) 
-  throws (1: InvalidRequestException ire, 2: NotFoundException nfe, 3: CassandraException
ce),
+  column_t       get_column(1:string tablename, 2:string key, 3:string columnFamily_column)
+  throws (1: InvalidRequestException ire, 2: NotFoundException nfe),
 
-  i32            get_column_count(string tablename,string key,string columnFamily_column)

-  throws (1: InvalidRequestException ire, 2: CassandraException ce),
+  i32            get_column_count(1:string tablename, 2:string key, 3:string columnFamily_column)
+  throws (1: InvalidRequestException ire),
 
-  async void     insert(string tablename,string key,string columnFamily_column, binary cellData,i64
timestamp),
+  async void     insert(1:string tablename, 2:string key, 3:string columnFamily_column, 4:binary
cellData, 5:i64 timestamp),
 
   async void     batch_insert(batch_mutation_t batchMutation),
 
+  bool           insert_blocking(1:string tablename, 2:string key, 3:string columnFamily_column,
4:binary cellData, 5:i64 timestamp)
+  throws (1: InvalidRequestException ire),
+
   bool           batch_insert_blocking(batch_mutation_t batchMutation)
   throws (1: InvalidRequestException ire),
 
-  bool           remove(string tablename,string key,string columnFamily_column, i64 timestamp,
bool block)
+  bool           remove(1:string tablename, 2:string key, 3:string columnFamily_column, 4:i64
timestamp, 5:bool block)
   throws (1: InvalidRequestException ire),
 
-  list<column_t> get_columns_since(string tablename, string key, string columnFamily_column,
i64 timeStamp) 
-  throws (1: InvalidRequestException ire, 2: NotFoundException nfe, 3: CassandraException
ce),
+  list<column_t> get_columns_since(1:string tablename, 2:string key, 3:string columnFamily_column,
4:i64 timeStamp)
+  throws (1: InvalidRequestException ire, 2: NotFoundException nfe),
 
-  list<superColumn_t> get_slice_super(string tablename, string key, string columnFamily_superColumnName,
i32 start = -1 , i32 count = -1) 
-  throws (1: InvalidRequestException ire, 2: CassandraException ce),
+  list<superColumn_t> get_slice_super(1:string tablename, 2:string key, 3:string columnFamily_superColumnName,
4:i32 start=-1, 5:i32 count=-1)
+  throws (1: InvalidRequestException ire),
 
-  list<superColumn_t> get_slice_super_by_names(string tablename,string key,string columnFamily,
list<string> superColumnNames) 
-  throws (1: InvalidRequestException ire, 2: CassandraException ce),
+  list<superColumn_t> get_slice_super_by_names(1:string tablename, 2:string key, 3:string
columnFamily, 4:list<string> superColumnNames)
+  throws (1: InvalidRequestException ire),
 
-  superColumn_t  get_superColumn(string tablename,string key,string columnFamily) 
-  throws (1: InvalidRequestException ire, 2: NotFoundException nfe, 3: CassandraException
ce),
+  superColumn_t  get_superColumn(1:string tablename, 2:string key, 3:string columnFamily)
+  throws (1: InvalidRequestException ire, 2: NotFoundException nfe),
 
   async void     batch_insert_superColumn(batch_mutation_super_t batchMutationSuper),
 
   bool           batch_insert_superColumn_blocking(batch_mutation_super_t batchMutationSuper)
   throws (1: InvalidRequestException ire),
 
-  async void     touch(string key,bool fData),
+  async void     touch(1:string key, 2:bool fData),
 
   /////////////////////////////////////////////////////////////////////////////////////
   // The following are beta APIs being introduced for CLI and/or CQL support.        //

Modified: incubator/cassandra/trunk/lib/libthrift.jar
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/lib/libthrift.jar?rev=768382&r1=768381&r2=768382&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/cli/CliClient.java?rev=768382&r1=768381&r2=768382&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/cli/CliClient.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/cli/CliClient.java Fri Apr 24 17:52:25
2009
@@ -22,12 +22,10 @@
 import org.antlr.runtime.tree.*;
 import org.apache.cassandra.cql.common.Utils;
 import org.apache.cassandra.service.Cassandra;
-import org.apache.cassandra.service.CassandraException;
 import org.apache.cassandra.service.CqlResult_t;
 import org.apache.cassandra.service.column_t;
 import org.apache.cassandra.service.NotFoundException;
 import org.apache.cassandra.service.InvalidRequestException;
-import org.apache.cassandra.service.Cassandra.Client;
 import org.apache.cassandra.utils.LogUtil;
 
 import java.util.*;
@@ -141,14 +139,7 @@
         {
             // table.cf['key']
         	List<column_t> columns = new ArrayList<column_t>();
-        	try
-        	{
-        		columns = thriftClient_.get_slice(tableName, key, columnFamily, -1, 1000000);
-        	}
-        	catch(CassandraException cex)
-        	{
-        		css_.out.println(LogUtil.throwableToString(cex));
-        	}
+      		columns = thriftClient_.get_slice(tableName, key, columnFamily, -1, 1000000);
             int size = columns.size();
             for (Iterator<column_t> colIter = columns.iterator(); colIter.hasNext();
)
             {
@@ -163,15 +154,7 @@
             // table.cf['key']['column']
             String columnName = CliCompiler.getColumn(columnFamilySpec, 0);
             column_t col = new column_t();
-            try
-            {
-            	col = thriftClient_.get_column(tableName, key, columnFamily + ":" + columnName);
-	    	}
-	    	catch(CassandraException cex)
-	    	{
-	    		css_.out.println(LogUtil.throwableToString(cex));
-	    	}
-            
+           	col = thriftClient_.get_column(tableName, key, columnFamily + ":" + columnName);
             css_.out.printf("==> (name=%s, value=%s; timestamp=%d)\n",
                             col.columnName, col.value, col.timestamp);
         }

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/cql/driver/CqlDriver.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/cql/driver/CqlDriver.java?rev=768382&r1=768381&r2=768382&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/cql/driver/CqlDriver.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/cql/driver/CqlDriver.java Fri Apr 24
17:52:25 2009
@@ -17,12 +17,6 @@
  */
 package org.apache.cassandra.cql.driver;
 
-import org.apache.cassandra.cql.compiler.common.*;
-import org.apache.cassandra.cql.compiler.parse.*;
-import org.apache.cassandra.cql.compiler.sem.*;
-import org.apache.cassandra.cql.common.*;
-import org.apache.thrift.*;
-
 import org.apache.cassandra.cql.common.CqlResult;
 import org.apache.cassandra.cql.common.Plan;
 import org.apache.cassandra.cql.compiler.common.CqlCompiler;
@@ -37,7 +31,7 @@
     private final static Logger logger_ = Logger.getLogger(CqlDriver.class);
 
     // Execute a CQL Statement 
-    public static CqlResult executeQuery(String query) throws TException 
+    public static CqlResult executeQuery(String query)
     {
         CqlCompiler compiler = new CqlCompiler();
 



Mime
View raw message