cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1074259 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/io/sstable/SSTableReader.java test/conf/cassandra.yaml test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
Date Thu, 24 Feb 2011 19:09:42 GMT
Author: jbellis
Date: Thu Feb 24 19:09:42 2011
New Revision: 1074259

URL: http://svn.apache.org/viewvc?rev=1074259&view=rev
Log:
fix supercolumn de/serialization when subcolumn comparator is different from supercolumn's
patch by slebresne; reviewed by jbellis for CASSANDRA-2104

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
    cassandra/branches/cassandra-0.7/test/conf/cassandra.yaml
    cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1074259&r1=1074258&r2=1074259&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Thu Feb 24 19:09:42 2011
@@ -29,6 +29,8 @@
  * set DEFAULT_MEMTABLE_LIFETIME_IN_MINS to 24h
  * improve detection and cleanup of partially-written sstables 
    (CASSANDRA-2206)
+ * fix supercolumn de/serialization when subcolumn comparator is different
+   from supercolumn's (CASSANDRA-2104)
 
 
 0.7.2

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableReader.java?rev=1074259&r1=1074258&r2=1074259&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
Thu Feb 24 19:09:42 2011
@@ -587,7 +587,7 @@ public class SSTableReader extends SSTab
     {
         return metadata.cfType == ColumnFamilyType.Standard
                ? Column.serializer()
-               : SuperColumn.serializer(getColumnComparator());
+               : SuperColumn.serializer(metadata.subcolumnComparator);
     }
 
     /**

Modified: cassandra/branches/cassandra-0.7/test/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/conf/cassandra.yaml?rev=1074259&r1=1074258&r2=1074259&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/conf/cassandra.yaml (original)
+++ cassandra/branches/cassandra-0.7/test/conf/cassandra.yaml Thu Feb 24 19:09:42 2011
@@ -173,6 +173,13 @@ keyspaces:
           rows_cached: 0
           keys_cached: 0
 
+        - name: Super5
+          column_type: Super
+          compare_with: TimeUUIDType
+          compare_subcolumns_with: BytesType
+          rows_cached: 0
+          keys_cached: 0
+
     - name: Keyspace5
       replica_placement_strategy: org.apache.cassandra.locator.SimpleStrategy
       replication_factor: 2

Modified: cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java?rev=1074259&r1=1074258&r2=1074259&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
(original)
+++ cassandra/branches/cassandra-0.7/test/unit/org/apache/cassandra/io/LazilyCompactedRowTest.java
Thu Feb 24 19:09:42 2011
@@ -42,6 +42,8 @@ import org.apache.cassandra.io.sstable.S
 import org.apache.cassandra.io.util.DataOutputBuffer;
 import org.apache.cassandra.io.util.MappedFileDataInput;
 import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.utils.UUIDGen;
 
 import org.junit.Test;
 
@@ -221,6 +223,28 @@ public class LazilyCompactedRowTest exte
         assertBytes(cfs, Integer.MAX_VALUE, true);
     }
 
+    @Test
+    public void testTwoRowSuperColumn() throws IOException, ExecutionException, InterruptedException
+    {
+        CompactionManager.instance.disableAutoCompaction();
+
+        Table table = Table.open("Keyspace4");
+        ColumnFamilyStore cfs = table.getColumnFamilyStore("Super5");
+
+        ByteBuffer key = ByteBufferUtil.bytes("k");
+        RowMutation rm = new RowMutation("Keyspace4", key);
+        ByteBuffer scKey = ByteBuffer.wrap(UUIDGen.decompose(UUIDGen.makeType1UUIDFromHost(FBUtilities.getLocalAddress())));
+        rm.add(new QueryPath("Super5", scKey , ByteBufferUtil.bytes("c")), ByteBufferUtil.EMPTY_BYTE_BUFFER,
0);
+        rm.apply();
+        cfs.forceBlockingFlush();
+
+        rm.apply();
+        cfs.forceBlockingFlush();
+
+        assertBytes(cfs, Integer.MAX_VALUE, true);
+    }
+
+
     private static class LazyCompactionIterator extends CompactionIterator
     {
         private final ColumnFamilyStore cfStore;



Mime
View raw message