cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r946481 - in /cassandra/trunk: src/java/org/apache/cassandra/db/RowMutation.java test/system/test_thrift_server.py
Date Wed, 19 May 2010 23:37:18 GMT
Author: jbellis
Date: Wed May 19 23:37:18 2010
New Revision: 946481

URL: http://svn.apache.org/viewvc?rev=946481&view=rev
Log:
test + fix for expiring columns.  patch by Jignesh Dhruv and Sylvain Lebresne for CASSANDRA-1109

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
    cassandra/trunk/test/system/test_thrift_server.py

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java?rev=946481&r1=946480&r2=946481&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java Wed May 19 23:37:18
2010
@@ -295,12 +295,12 @@ public class RowMutation
         {
             for (org.apache.cassandra.thrift.Column column : cosc.super_column.columns)
             {
-                rm.add(new QueryPath(cfName, cosc.super_column.name, column.name), column.value,
column.timestamp);
+                rm.add(new QueryPath(cfName, cosc.super_column.name, column.name), column.value,
column.timestamp, column.ttl);
             }
         }
         else
         {
-            rm.add(new QueryPath(cfName, null, cosc.column.name), cosc.column.value, cosc.column.timestamp);
+            rm.add(new QueryPath(cfName, null, cosc.column.name), cosc.column.value, cosc.column.timestamp,
cosc.column.ttl);
         }
     }
 

Modified: cassandra/trunk/test/system/test_thrift_server.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_thrift_server.py?rev=946481&r1=946480&r2=946481&view=diff
==============================================================================
--- cassandra/trunk/test/system/test_thrift_server.py (original)
+++ cassandra/trunk/test/system/test_thrift_server.py Wed May 19 23:37:18 2010
@@ -1124,6 +1124,19 @@ class TestMutations(ThriftTester):
         assert client.get('key1', ColumnPath('Standard1', column='cttl3'), ConsistencyLevel.ONE).column
== column
         time.sleep(2)
         _expect_missing(lambda: client.get('key1', ColumnPath('Standard1', column='cttl3'),
ConsistencyLevel.ONE))
+    
+    def test_simple_expiration_batch_mutate(self):
+        """ Test that column ttled do expires using batch_mutate """
+        _set_keyspace('Keyspace1')
+        column = Column('cttl4', 'value1', 0, 2)
+        cfmap = {'Standard1': [Mutation(ColumnOrSuperColumn(column))]}
+        client.batch_mutate({'key1': cfmap}, ConsistencyLevel.ONE)
+        time.sleep(1)
+        c = client.get('key1', ColumnPath('Standard1', column='cttl4'), ConsistencyLevel.ONE).column
+        assert c == column
+        assert client.get('key1', ColumnPath('Standard1', column='cttl4'), ConsistencyLevel.ONE).column
== column
+        time.sleep(2)
+        _expect_missing(lambda: client.get('key1', ColumnPath('Standard1', column='cttl3'),
ConsistencyLevel.ONE))
 
     def test_update_expiring(self):
         """ Test that updating a column with ttl override the ttl """



Mime
View raw message