Permalink
Browse files

generate supercolumn tombstone when a 2-tuple delete is passed to a s…

…uper CF.

patch by jbellis; reviewed by Sandeep Tata for #84
  • Loading branch information...
1 parent 86ae5ec commit a27124dd18a002fa74e51b89055def68e28da338 Jonathan Ellis committed Apr 16, 2009
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/org/apache/cassandra/db/RowMutation.java
View
12 src/org/apache/cassandra/db/RowMutation.java
@@ -42,6 +42,7 @@
import org.apache.cassandra.service.column_t;
import org.apache.cassandra.service.superColumn_t;
import org.apache.cassandra.utils.FBUtilities;
+import org.apache.cassandra.config.DatabaseDescriptor;
/**
@@ -187,7 +188,16 @@ public void delete(String columnFamilyColumn, long timestamp)
columnFamily = new ColumnFamily(cfName);
if (values.length == 2)
{
- columnFamily.addColumn(values[1], ArrayUtils.EMPTY_BYTE_ARRAY, timestamp, true);
+ if (DatabaseDescriptor.getColumnFamilyType(cfName).equals("Standard"))
+ {
+ columnFamily.addColumn(values[1], ArrayUtils.EMPTY_BYTE_ARRAY, timestamp, true);
+ }
+ else
+ {
+ SuperColumn sc = new SuperColumn(values[1]);
+ sc.markForDeleteAt(timestamp);
+ columnFamily.addColumn(sc);
+ }
}
else if (values.length == 3)
{

0 comments on commit a27124d

Please sign in to comment.