cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1095767 - in /cassandra/branches/cassandra-0.8: ./ contrib/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/utils/ test/unit/org/apache/cassandra/cli/ test/unit/org/ap...
Date Thu, 21 Apr 2011 16:17:09 GMT
Author: jbellis
Date: Thu Apr 21 16:17:08 2011
New Revision: 1095767

URL: http://svn.apache.org/viewvc?rev=1095767&view=rev
Log:
merge from 0.7

Modified:
    cassandra/branches/cassandra-0.8/   (props changed)
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/contrib/   (props changed)
    cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
  (props changed)
    cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
  (props changed)
    cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliUtils.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/utils/FBUtilities.java
    cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/cli/CliTest.java
    cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/service/AntiEntropyServiceTestAbstract.java

Propchange: cassandra/branches/cassandra-0.8/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 21 16:17:08 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7:1026516-1094195,1094604,1094611,1094647,1094694,1094780,1094789,1094796,1094809,1094818,1094831,1095250,1095438,1095473,1095696,1095747
+/cassandra/branches/cassandra-0.7:1026516-1095250,1095438,1095473,1095696,1095747
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /cassandra/trunk:1090978-1090979

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1095767&r1=1095766&r2=1095767&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Thu Apr 21 16:17:08 2011
@@ -57,15 +57,13 @@
  * use 64KB flush buffer instead of in_memory_compaction_limit (CASSANDRA-2463)
  * fix duplicate results from CFS.scan (CASSANDRA-2406)
  * avoid caching token-only decoratedkeys (CASSANDRA-2416)
-<<<<<<< .working
  * count a row deletion as one operation towards memtable threshold 
    (CASSANDRA-2519)
  * fixes for verifying destination availability under hinted conditions
    so UE can be thrown intead of timing out (CASSANDRA-2514)
  * support LOCAL_QUORUM, EACH_QUORUM CLs outside of NTS (CASSANDRA-2516)
-=======
  * preserve version when streaming data from old sstables (CASSANDRA-2283)
->>>>>>> .merge-right.r1094789
+ * fix backslash substitutions in CLI (CASSANDRA-2492)
 
 
 0.7.4

Propchange: cassandra/branches/cassandra-0.8/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 21 16:17:08 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
-/cassandra/branches/cassandra-0.7/contrib:1026516-1094195,1094604,1094611,1094647,1094694,1094780,1094789,1094796,1094809,1094818,1094831,1095250,1095438,1095473,1095696,1095747
+/cassandra/branches/cassandra-0.7/contrib:1026516-1095250,1095438,1095473,1095696,1095747
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
 /cassandra/trunk/contrib:1090978-1090979

Propchange: cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 21 16:17:08 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1094195,1094604,1094611,1094647,1094694,1094780,1094789,1094796,1094809,1094818,1094831,1095250,1095438,1095473,1095696,1095747
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1095250,1095438,1095473,1095696,1095747
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090978-1090979

Propchange: cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 21 16:17:08 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1094195,1094604,1094611,1094647,1094694,1094780,1094789,1094796,1094809,1094818,1094831,1095250,1095438,1095473,1095696,1095747
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1095250,1095438,1095473,1095696,1095747
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090978-1090979

Propchange: cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 21 16:17:08 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1094195,1094604,1094611,1094647,1094694,1094780,1094789,1094796,1094809,1094818,1094831,1095250,1095438,1095473,1095696,1095747
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1095250,1095438,1095473,1095696,1095747
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090978-1090979

Propchange: cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 21 16:17:08 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1094195,1094604,1094611,1094647,1094694,1094780,1094789,1094796,1094809,1094818,1094831,1095250,1095438,1095473,1095696,1095747
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1095250,1095438,1095473,1095696,1095747
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090978-1090979

Propchange: cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 21 16:17:08 2011
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1094195,1094604,1094611,1094647,1094694,1094780,1094789,1094796,1094809,1094818,1094831,1095250,1095438,1095473,1095696,1095747
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1095250,1095438,1095473,1095696,1095747
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 /cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090978-1090979

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliUtils.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliUtils.java?rev=1095767&r1=1095766&r2=1095767&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliUtils.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cli/CliUtils.java Thu Apr
21 16:17:08 2011
@@ -6,6 +6,7 @@ import java.util.Set;
 import org.apache.cassandra.thrift.CfDef;
 import org.apache.cassandra.thrift.IndexOperator;
 import org.apache.cassandra.thrift.KsDef;
+import org.apache.commons.lang.StringEscapeUtils;
 /*
  * 
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -38,70 +39,16 @@ public class CliUtils
      */
     public static String unescapeSQLString(String b)
     {
-        int j = 1;
-        final char start = b.charAt(0);
-        final char end = b.charAt(b.length() - 1);
-
-        if (start != '\'' && end != '\'')
-        {
-            j = 0;
-        }
-
-        StringBuilder sb = new StringBuilder(b.length());
-
-        for (int i = j; ((j == 0) ? i : i + 1) < b.length(); i++)
-        {
-            if (b.charAt(i) == '\\' && i + 2 < b.length())
-            {
-                char n = b.charAt(i + 1);
-                switch (n)
-                {
-                    case '0':
-                        sb.append("\0");
-                        break;
-                    case '\'':
-                        sb.append("'");
-                        break;
-                    case '"':
-                        sb.append("\"");
-                        break;
-                    case 'b':
-                        sb.append("\b");
-                        break;
-                    case 'n':
-                        sb.append("\n");
-                        break;
-                    case 'r':
-                        sb.append("\r");
-                        break;
-                    case 't':
-                        sb.append("\t");
-                        break;
-                    case 'Z':
-                        sb.append("\u001A");
-                        break;
-                    case '\\':
-                        sb.append("\\");
-                        break;
-                    case '%':
-                        sb.append("%");
-                        break;
-                    case '_':
-                        sb.append("_");
-                        break;
-                    default:
-                        sb.append(n);
-                }
-            }
-            else
-            {
-                sb.append(b.charAt(i));
-            }
-        }
-
-        return sb.toString();
+        if (b.charAt(0) == '\'' && b.charAt(b.length()-1) == '\'')
+            b = b.substring(1, b.length()-1);
+        return StringEscapeUtils.unescapeJava(b);
     }
 
+    public static String escapeSQLString(String b)
+    {
+        // single quotes are not escaped in java, need to be for cli
+        return StringEscapeUtils.escapeJava(b).replace("\'", "\\'");
+    }
     /**
      * Returns IndexOperator from string representation
      * @param operator - string representing IndexOperator (=, >=, >, <, <=)

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/utils/FBUtilities.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/utils/FBUtilities.java?rev=1095767&r1=1095766&r2=1095767&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/utils/FBUtilities.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/utils/FBUtilities.java
Thu Apr 21 16:17:08 2011
@@ -602,7 +602,7 @@ public class FBUtilities
 
     public static String toString(Map<?,?> map)
     {
-        Joiner.MapJoiner joiner = Joiner.on(",").withKeyValueSeparator(":");
+        Joiner.MapJoiner joiner = Joiner.on(", ").withKeyValueSeparator(":");
         return joiner.join(map);
     }
 

Modified: cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/cli/CliTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/cli/CliTest.java?rev=1095767&r1=1095766&r2=1095767&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/cli/CliTest.java (original)
+++ cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/cli/CliTest.java Thu Apr
21 16:17:08 2011
@@ -245,4 +245,17 @@ public class CliTest extends CleanupHelp
             errStream.reset(); // no errors to the end user.
         }
     }
-}
+
+    @Test
+    public void testEscape()
+    {
+        //escaped is the string read from the cli.
+        String escaped = "backspace \\b tab \\t linefeed \\n form feed \\f carriage return
\\r duble quote \\\" " +
+                "single quote \\' backslash \\\\";
+        String unescaped = "backspace \b tab \t linefeed \n form feed \f carriage return
\r duble quote \" " +
+                "single quote ' backslash \\";
+        // when read from the cli may have single quotes around it
+        assertEquals(unescaped, CliUtils.unescapeSQLString("'" + escaped + "'"));
+        assertEquals(escaped, CliUtils.escapeSQLString(unescaped));
+    }
+}
\ No newline at end of file

Modified: cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/service/AntiEntropyServiceTestAbstract.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/service/AntiEntropyServiceTestAbstract.java?rev=1095767&r1=1095766&r2=1095767&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/service/AntiEntropyServiceTestAbstract.java
(original)
+++ cassandra/branches/cassandra-0.8/test/unit/org/apache/cassandra/service/AntiEntropyServiceTestAbstract.java
Thu Apr 21 16:17:08 2011
@@ -106,7 +106,7 @@ public abstract class AntiEntropyService
         Gossiper.instance.initializeNodeUnsafe(REMOTE, 1);
 
         local_range = StorageService.instance.getLocalPrimaryRange();
-        
+
         // random session id for each test
         request = new TreeRequest(UUID.randomUUID().toString(), LOCAL, local_range, new CFPair(tablename,
cfname));
     }



Mime
View raw message