Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add testRemoveColumnFamily, testRemoveSubColumn. (these do not pass y…

…et b/c of

cleanup problems.)  patch by jbellis; reviewed by Sandeep Tata for #85
  • Loading branch information...
commit ef4bf8c27723fd67cb80e521047ac112265e9be4 1 parent 13dde30
Jonathan Ellis authored
Showing with 47 additions and 1 deletion.
  1. +47 −1 test/org/apache/cassandra/db/ColumnFamilyStoreTest.java
48 test/org/apache/cassandra/db/ColumnFamilyStoreTest.java
View
@@ -203,7 +203,7 @@ private void validateNameSort(Table table)
}
@Test
- public void testRemove() throws IOException, ColumnFamilyNotDefinedException, ExecutionException, InterruptedException
+ public void testRemoveColumn() throws IOException, ColumnFamilyNotDefinedException, ExecutionException, InterruptedException
{
Table table = Table.open("Table1");
ColumnFamilyStore store = table.getColumnFamilyStore("Standard1");
@@ -226,6 +226,29 @@ public void testRemove() throws IOException, ColumnFamilyNotDefinedException, Ex
}
@Test
+ public void testRemoveSubColumn() throws IOException, ColumnFamilyNotDefinedException, ExecutionException, InterruptedException
+ {
+ Table table = Table.open("Table1");
+ ColumnFamilyStore store = table.getColumnFamilyStore("Super1");
+ RowMutation rm;
+
+ // add data
+ rm = new RowMutation("Table1", "key1");
+ rm.add("Super1:SC1:Column1", "asdf".getBytes(), 0);
+ rm.apply();
+ store.forceFlush();
+ waitForFlush();
+
+ // remove
+ rm = new RowMutation("Table1", "key1");
+ rm.delete("Super1:SC1:Column1", 1);
+ rm.apply();
+
+ ColumnFamily retrieved = store.getColumnFamily("key1", "Super1:SC1", new IdentityFilter());
+ assert retrieved.getColumnCount() == 0;
+ }
+
+ @Test
public void testRemoveSuperColumn() throws IOException, ColumnFamilyNotDefinedException, ExecutionException, InterruptedException
{
Table table = Table.open("Table1");
@@ -256,6 +279,29 @@ public void testRemoveSuperColumn() throws IOException, ColumnFamilyNotDefinedEx
}
@Test
+ public void testRemoveColumnFamily() throws IOException, ColumnFamilyNotDefinedException, ExecutionException, InterruptedException
+ {
+ Table table = Table.open("Table1");
+ ColumnFamilyStore store = table.getColumnFamilyStore("Standard1");
+ RowMutation rm;
+
+ // add data
+ rm = new RowMutation("Table1", "key1");
+ rm.add("Standard1:Column1", "asdf".getBytes(), 0);
+ rm.add("Standard1:Column2", "asdf".getBytes(), 0);
+ rm.apply();
+ store.forceBlockingFlush();
+
+ // remove
+ rm = new RowMutation("Table1", "key1");
+ rm.delete("Standard1", 1);
+ rm.apply();
+
+ ColumnFamily retrieved = store.getColumnFamily("key1", "Standard1", new IdentityFilter());
+ assert retrieved.getColumnCount() == 0;
+ }
+
+ @Test
public void testGetCompactionBuckets() throws IOException
{
// create files 20 40 60 ... 180
Please sign in to comment.
Something went wrong with that request. Please try again.