cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r1126736 - /cassandra/branches/cassandra-0.8/drivers/py/cqlsh
Date Mon, 23 May 2011 20:46:13 GMT
Author: eevans
Date: Mon May 23 20:46:13 2011
New Revision: 1126736

URL: http://svn.apache.org/viewvc?rev=1126736&view=rev
Log:
work-around schema disagreements

Patch by eevans; review by jbellis for CASSANDRA-2649

Modified:
    cassandra/branches/cassandra-0.8/drivers/py/cqlsh

Modified: cassandra/branches/cassandra-0.8/drivers/py/cqlsh
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/drivers/py/cqlsh?rev=1126736&r1=1126735&r2=1126736&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/drivers/py/cqlsh (original)
+++ cassandra/branches/cassandra-0.8/drivers/py/cqlsh Mon May 23 20:46:13 2011
@@ -24,6 +24,7 @@ import sys
 import readline
 import os
 import re
+import time
 
 try:
     import cql
@@ -129,7 +130,13 @@ class Shell(cmd.Cmd):
         statement = self.get_statement(input)
         if not statement: return
 
-        self.cursor.execute(statement)
+        for i in range(1,4):
+            try:
+                self.cursor.execute(statement)
+                break
+            except cql.IntegrityError, err:
+                self.printerr("Attempt #%d: %s" % (i, str(err)), color=RED)
+                time.sleep(1*i)
 
         if self.cursor.description is _COUNT_DESCRIPTION:
             if self.cursor.result: print self.cursor.result[0]



Mime
View raw message