cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r769629 - in /incubator/cassandra/trunk: src/org/apache/cassandra/db/SliceReadCommand.java test/system/test_server.py
Date Wed, 29 Apr 2009 02:01:57 GMT
Author: jbellis
Date: Wed Apr 29 02:01:56 2009
New Revision: 769629

URL: http://svn.apache.org/viewvc?rev=769629&view=rev
Log:
fix regression introduced by ReadCommand refactor (get_slice can return column_t from a standard
cf, or from a supercolumn in a super cf).  patch by jbellis.

Modified:
    incubator/cassandra/trunk/src/org/apache/cassandra/db/SliceReadCommand.java
    incubator/cassandra/trunk/test/system/test_server.py

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/db/SliceReadCommand.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/db/SliceReadCommand.java?rev=769629&r1=769628&r2=769629&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/db/SliceReadCommand.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/db/SliceReadCommand.java Wed Apr 29
02:01:56 2009
@@ -23,14 +23,16 @@
 
 public class SliceReadCommand extends ReadCommand
 {
-    public final String columnFamily;
+    /* for a slice of a standard column, cFC should only be the CF name.
+       for a supercolumn slice, it will be CF:supercolumn. */
+    public final String columnFamilyColumn;
     public final int start;
     public final int count;
 
-    public SliceReadCommand(String table, String key, String columnFamily, int start, int
count)
+    public SliceReadCommand(String table, String key, String columnFamilyColumn, int start,
int count)
     {
         super(table, key, CMD_TYPE_GET_SLICE);
-        this.columnFamily = columnFamily;
+        this.columnFamilyColumn = columnFamilyColumn;
         this.start = start;
         this.count = count;
     }
@@ -38,13 +40,13 @@
     @Override
     public String getColumnFamilyName()
     {
-        return columnFamily;
+        return RowMutation.getColumnAndColumnFamily(columnFamilyColumn)[0];
     }
 
     @Override
     public ReadCommand copy()
     {
-        ReadCommand readCommand= new SliceReadCommand(table, key, columnFamily, start, count);
+        ReadCommand readCommand = new SliceReadCommand(table, key, columnFamilyColumn, start,
count);
         readCommand.setDigestQuery(isDigestQuery());
         return readCommand;
     }
@@ -52,7 +54,7 @@
     @Override
     public Row getRow(Table table) throws IOException
     {
-        return table.getRow(key, columnFamily, start, count);
+        return table.getRow(key, columnFamilyColumn, start, count);
     }
 
     @Override
@@ -61,7 +63,7 @@
         return "GetSliceReadMessage(" +
                "table='" + table + '\'' +
                ", key='" + key + '\'' +
-               ", columnFamily='" + columnFamily + '\'' +
+               ", columnFamily='" + columnFamilyColumn + '\'' +
                ", start='" + start + '\'' +
                ", count='" + count + '\'' +
                ')';
@@ -77,7 +79,7 @@
         dos.writeBoolean(realRM.isDigestQuery());
         dos.writeUTF(realRM.table);
         dos.writeUTF(realRM.key);
-        dos.writeUTF(realRM.columnFamily);
+        dos.writeUTF(realRM.columnFamilyColumn);
         dos.writeInt(realRM.start);
         dos.writeInt(realRM.count);
     }

Modified: incubator/cassandra/trunk/test/system/test_server.py
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/system/test_server.py?rev=769629&r1=769628&r2=769629&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/system/test_server.py (original)
+++ incubator/cassandra/trunk/test/system/test_server.py Wed Apr 29 02:01:56 2009
@@ -197,7 +197,7 @@
         client.remove('Table1', 'key1', 'Super1:sc2', 5, True)
         time.sleep(0.1)
         _expect_missing(lambda: client.get_column('Table1', 'key1', 'Super1:sc2:c5'))
-        actual = client.get_slice_super('Table1', 'key1', 'Super1:sc2', -1, -1)
+        actual = client.get_slice('Table1', 'key1', 'Super1:sc2', -1, -1)
         assert actual == [], actual
         scs = [superColumn_t(name='sc1', 
                              columns=[column_t(columnName='c4', value='value4', timestamp=0)])]



Mime
View raw message