cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r1081973 - in /cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc: CassandraConnection.java CassandraStatement.java Connection.java
Date Tue, 15 Mar 2011 22:52:36 GMT
Author: eevans
Date: Tue Mar 15 22:52:36 2011
New Revision: 1081973

URL: http://svn.apache.org/viewvc?rev=1081973&view=rev
Log:
update JDBC driver for SchemaDisagreementException

Patch by eevans; reviewed by brandon.williams for CASSANDRA-2334

Modified:
    cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java
    cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraStatement.java
    cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/Connection.java

Modified: cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java?rev=1081973&r1=1081972&r2=1081973&view=diff
==============================================================================
--- cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java
(original)
+++ cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraConnection.java
Tue Mar 15 22:52:36 2011
@@ -41,6 +41,7 @@ import java.util.Properties;
 import org.apache.cassandra.thrift.AuthenticationException;
 import org.apache.cassandra.thrift.AuthorizationException;
 import org.apache.cassandra.thrift.InvalidRequestException;
+import org.apache.cassandra.thrift.SchemaDisagreementException;
 import org.apache.cassandra.thrift.TimedOutException;
 import org.apache.cassandra.thrift.UnavailableException;
 import org.apache.thrift.TException;
@@ -113,6 +114,10 @@ public class CassandraConnection impleme
         {
             throw new DriverResolverException(e.getMessage());
         }
+        catch (SchemaDisagreementException e)
+        {
+            throw new DriverResolverException("schema does not match across nodes, (try again
later).");
+        }
 
     }
     

Modified: cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraStatement.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraStatement.java?rev=1081973&r1=1081972&r2=1081973&view=diff
==============================================================================
--- cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraStatement.java
(original)
+++ cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/CassandraStatement.java
Tue Mar 15 22:52:36 2011
@@ -47,6 +47,7 @@ import java.util.regex.Pattern;
 import org.apache.cassandra.thrift.CqlResult;
 import org.apache.cassandra.thrift.CqlResultType;
 import org.apache.cassandra.thrift.InvalidRequestException;
+import org.apache.cassandra.thrift.SchemaDisagreementException;
 import org.apache.cassandra.thrift.TimedOutException;
 import org.apache.cassandra.thrift.UnavailableException;
 import org.apache.thrift.TException;
@@ -182,6 +183,10 @@ class CassandraStatement implements Prep
         {
             throw new SQLException(e.getMessage());
         }
+        catch (SchemaDisagreementException e)
+        {
+            throw new SQLException("schema does not match across nodes, (try again later).");
+        }
         catch (TException e)
         {
             throw new SQLException(e.getMessage());
@@ -260,6 +265,10 @@ class CassandraStatement implements Prep
         {
             throw new SQLException(e.getMessage());
         }
+        catch (SchemaDisagreementException e)
+        {
+            throw new SQLException("schema does not match across nodes, (try again later).");
+        }
         catch (TException e)
         {
             throw new SQLException(e.getMessage());
@@ -294,6 +303,10 @@ class CassandraStatement implements Prep
         {
             throw new SQLException(e.getMessage());
         }
+        catch (SchemaDisagreementException e)
+        {
+            throw new SQLException("schema does not match across nodes, (try again later).");
+        }
         catch (TException e)
         {
             throw new SQLException(e.getMessage());

Modified: cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/Connection.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/Connection.java?rev=1081973&r1=1081972&r2=1081973&view=diff
==============================================================================
--- cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/Connection.java (original)
+++ cassandra/trunk/drivers/java/src/org/apache/cassandra/cql/jdbc/Connection.java Tue Mar
15 22:52:36 2011
@@ -33,6 +33,7 @@ import org.apache.cassandra.thrift.Cassa
 import org.apache.cassandra.thrift.Compression;
 import org.apache.cassandra.thrift.CqlResult;
 import org.apache.cassandra.thrift.InvalidRequestException;
+import org.apache.cassandra.thrift.SchemaDisagreementException;
 import org.apache.cassandra.thrift.TimedOutException;
 import org.apache.cassandra.thrift.UnavailableException;
 import org.apache.thrift.TException;
@@ -117,7 +118,7 @@ class Connection
      * @throws TException
      */
     public CqlResult execute(String queryStr)
-    throws InvalidRequestException, UnavailableException, TimedOutException, TException
+    throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException,
TException
     {
         return execute(queryStr, defaultCompression);
     }
@@ -134,7 +135,7 @@ class Connection
      * @throws TException
      */
     public CqlResult execute(String queryStr, Compression compress)
-    throws InvalidRequestException, UnavailableException, TimedOutException, TException
+    throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException,
TException
     {
         if (decoder == null)
             decoder = new ColumnDecoder(client.describe_keyspaces());



Mime
View raw message