cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject svn commit: r1091151 - in /cassandra/trunk: ./ contrib/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/thrift/ test/system/
Date Mon, 11 Apr 2011 18:00:23 GMT
Author: slebresne
Date: Mon Apr 11 18:00:23 2011
New Revision: 1091151

URL: http://svn.apache.org/viewvc?rev=1091151&view=rev
Log:
Merge CASSANDRA-2342 from 0.8.

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/contrib/   (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
    cassandra/trunk/test/system/test_thrift_server.py

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 18:00:23 2011
@@ -1,6 +1,7 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1081914,1083000
 /cassandra/branches/cassandra-0.7:1026516-1090647
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
+/cassandra/branches/cassandra-0.8:1091148
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1091151&r1=1091150&r2=1091151&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Mon Apr 11 18:00:23 2011
@@ -1,16 +1,16 @@
 0.8-dev
  * remove Avro RPC support (CASSANDRA-926)
- * avoid double RowMutation serialization on write path (CASSANDRA-1800)
  * adds support for columns that act as incr/decr counters 
-   (CASSANDRA-1072, 1937, 1944, 1936, 2101, 2093, 2288, 2105, 2384)
+   (CASSANDRA-1072, 1937, 1944, 1936, 2101, 2093, 2288, 2105, 2384, 2236, 2342)
+ * CQL (CASSANDRA-1703, 1704, 1705, 1706, 1707, 1708, 1710, 1711, 1940, 
+   2124, 2302, 2277)
+ * avoid double RowMutation serialization on write path (CASSANDRA-1800)
  * make NetworkTopologyStrategy the default (CASSANDRA-1960)
  * configurable internode encryption (CASSANDRA-1567)
  * human readable column names in sstable2json output (CASSANDRA-1933)
  * change default JMX port to 7199 (CASSANDRA-2027)
  * backwards compatible internal messaging (CASSANDRA-1015)
  * check for null encryption in MessagingService (CASSANDRA-2152)
- * Fix for Cli to support updating replicate_on_write (CASSANDRA-2236)
- * JDBC driver for CQL (CASSANDRA-2124, 2302, 2277)
  * atomic switch of memtables and sstables (CASSANDRA-2284)
  * add pluggable SeedProvider (CASSANDRA-1669)
  * Fix clustertool to not throw exception when calling get_endpoints (CASSANDRA-2437)

Propchange: cassandra/trunk/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 18:00:23 2011
@@ -1,6 +1,7 @@
 /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
 /cassandra/branches/cassandra-0.7/contrib:1026516-1090647
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
+/cassandra/branches/cassandra-0.8/contrib:1091148
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/contrib:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/contrib:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 18:00:23 2011
@@ -1,6 +1,7 @@
 /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-1090647
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1091148
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 18:00:23 2011
@@ -1,6 +1,7 @@
 /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-1090647
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1091148
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 18:00:23 2011
@@ -1,6 +1,7 @@
 /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-1090647
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1091148
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 18:00:23 2011
@@ -1,6 +1,7 @@
 /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-1090647
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1091148
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 11 18:00:23 2011
@@ -1,6 +1,7 @@
 /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-1090647
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1091148
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350

Modified: cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java?rev=1091151&r1=1091150&r2=1091151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Mon Apr 11 18:00:23 2011
@@ -2206,6 +2206,24 @@ public class CliClient extends CliUserHe
 
                     sessionState.out.println(")");
                 }
+                else if (columnOrSuperColumn.counter_column != null)
+                {
+                    CounterColumn col = columnOrSuperColumn.counter_column;
+
+                    sessionState.out.printf("=> (counter=%s, value=%s)%n", formatColumnName(keySpace,
columnFamilyName, col.name), col.value);
+                }
+                else if (columnOrSuperColumn.counter_super_column != null)
+                {
+                    CounterSuperColumn superCol = columnOrSuperColumn.counter_super_column;
+                    sessionState.out.printf("=> (super_column=%s,", formatColumnName(keySpace,
columnFamilyName, superCol.name));
+
+                    for (CounterColumn col : superCol.columns)
+                    {
+                        sessionState.out.printf("%n     (counter=%s, value=%s)", formatSubcolumnName(keySpace,
columnFamilyName, col.name), col.value);
+                    }
+
+                    sessionState.out.println(")");
+                }
             }
         }
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java?rev=1091151&r1=1091150&r2=1091151&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java Mon Apr 11 18:00:23
2011
@@ -575,7 +575,7 @@ public class CassandraServer implements 
         String keyspace = state().getKeyspace();
         state().hasColumnFamilyAccess(column_parent.column_family, Permission.READ);
 
-        CFMetaData metadata = ThriftValidation.validateColumnFamily(keyspace, column_parent.column_family,
false);
+        CFMetaData metadata = ThriftValidation.validateColumnFamily(keyspace, column_parent.column_family);
         ThriftValidation.validateColumnParent(metadata, column_parent);
         ThriftValidation.validatePredicate(metadata, column_parent, predicate);
         ThriftValidation.validateKeyRange(range);

Modified: cassandra/trunk/test/system/test_thrift_server.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_thrift_server.py?rev=1091151&r1=1091150&r2=1091151&view=diff
==============================================================================
--- cassandra/trunk/test/system/test_thrift_server.py (original)
+++ cassandra/trunk/test/system/test_thrift_server.py Mon Apr 11 18:00:23 2011
@@ -105,6 +105,12 @@ def _insert_range():
     client.insert('key1', ColumnParent('Standard1'), Column('c3', 'value3', 0), ConsistencyLevel.ONE)
     time.sleep(0.1)
 
+def _insert_counter_range():
+    client.add('key1', ColumnParent('Counter1'), CounterColumn('c1', 1), ConsistencyLevel.ONE)
+    client.add('key1', ColumnParent('Counter1'), CounterColumn('c2', 2), ConsistencyLevel.ONE)
+    client.add('key1', ColumnParent('Counter1'), CounterColumn('c3', 3), ConsistencyLevel.ONE)
+    time.sleep(0.1)
+
 def _verify_range():
     p = SlicePredicate(slice_range=SliceRange('c1', 'c2', False, 1000))
     result = client.get_slice('key1', ColumnParent('Standard1'), p, ConsistencyLevel.ONE)
@@ -126,6 +132,27 @@ def _verify_range():
     result = client.get_slice('key1', ColumnParent('Standard1'), p, ConsistencyLevel.ONE)
     assert len(result) == 2, result
 
+def _verify_counter_range():
+    p = SlicePredicate(slice_range=SliceRange('c1', 'c2', False, 1000))
+    result = client.get_slice('key1', ColumnParent('Counter1'), p, ConsistencyLevel.ONE)
+    assert len(result) == 2
+    assert result[0].counter_column.name == 'c1'
+    assert result[1].counter_column.name == 'c2'
+
+    p = SlicePredicate(slice_range=SliceRange('c3', 'c2', True, 1000))
+    result = client.get_slice('key1', ColumnParent('Counter1'), p, ConsistencyLevel.ONE)
+    assert len(result) == 2
+    assert result[0].counter_column.name == 'c3'
+    assert result[1].counter_column.name == 'c2'
+
+    p = SlicePredicate(slice_range=SliceRange('a', 'z', False, 1000))
+    result = client.get_slice('key1', ColumnParent('Counter1'), p, ConsistencyLevel.ONE)
+    assert len(result) == 3, result
+
+    p = SlicePredicate(slice_range=SliceRange('a', 'z', False, 2))
+    result = client.get_slice('key1', ColumnParent('Counter1'), p, ConsistencyLevel.ONE)
+    assert len(result) == 2, result
+
 def _set_keyspace(keyspace):
     client.set_keyspace(keyspace)
 
@@ -136,6 +163,13 @@ def _insert_super_range():
     client.insert('key1', ColumnParent('Super1', 'sc3'), Column(_i64(7), 'value7', 0), ConsistencyLevel.ONE)
     time.sleep(0.1)
 
+def _insert_counter_super_range():
+    client.add('key1', ColumnParent('SuperCounter1', 'sc1'), CounterColumn(_i64(4), 4), ConsistencyLevel.ONE)
+    client.add('key1', ColumnParent('SuperCounter1', 'sc2'), CounterColumn(_i64(5), 5), ConsistencyLevel.ONE)
+    client.add('key1', ColumnParent('SuperCounter1', 'sc2'), CounterColumn(_i64(6), 6), ConsistencyLevel.ONE)
+    client.add('key1', ColumnParent('SuperCounter1', 'sc3'), CounterColumn(_i64(7), 7), ConsistencyLevel.ONE)
+    time.sleep(0.1)
+
 def _verify_super_range():
     p = SlicePredicate(slice_range=SliceRange('sc2', 'sc3', False, 2))
     result = client.get_slice('key1', ColumnParent('Super1'), p, ConsistencyLevel.ONE)
@@ -149,6 +183,19 @@ def _verify_super_range():
     assert result[0].super_column.name == 'sc3'
     assert result[1].super_column.name == 'sc2'
 
+def _verify_counter_super_range():
+    p = SlicePredicate(slice_range=SliceRange('sc2', 'sc3', False, 2))
+    result = client.get_slice('key1', ColumnParent('SuperCounter1'), p, ConsistencyLevel.ONE)
+    assert len(result) == 2
+    assert result[0].counter_super_column.name == 'sc2'
+    assert result[1].counter_super_column.name == 'sc3'
+
+    p = SlicePredicate(slice_range=SliceRange('sc3', 'sc2', True, 2))
+    result = client.get_slice('key1', ColumnParent('SuperCounter1'), p, ConsistencyLevel.ONE)
+    assert len(result) == 2
+    assert result[0].counter_super_column.name == 'sc3'
+    assert result[1].counter_super_column.name == 'sc2'
+
 def _verify_super(supercf='Super1', key='key1'):
     assert client.get(key, ColumnPath(supercf, 'sc1', _i64(4)), ConsistencyLevel.ONE).column
== Column(_i64(4), 'value4', 0)
     slice = [result.super_column
@@ -1742,6 +1789,16 @@ class TestMutations(ThriftTester):
         assert counters['key2'][0].counter_column.value == d1+d2
         assert counters['key2'][1].counter_column.value == d1
 
+    def test_counter_get_slice_range(self):
+        _set_keyspace('Keyspace1')
+        _insert_counter_range()
+        _verify_counter_range()
+
+    def test_counter_get_slice_super_range(self):
+        _set_keyspace('Keyspace1')
+        _insert_counter_super_range()
+        _verify_counter_super_range()
+
     def test_index_scan(self):
         _set_keyspace('Keyspace1')
         client.insert('key1', ColumnParent('Indexed1'), Column('birthdate', _i64(1), 0),
ConsistencyLevel.ONE)



Mime
View raw message