Search in sources :

Example 1 with SSTableDeletingNotification

use of org.apache.cassandra.notifications.SSTableDeletingNotification in project cassandra by apache.

the class CompactionStrategyManagerPendingRepairTest method sstableDeleted.

@Test
public void sstableDeleted() {
    UUID repairID = registerSession(cfs, true, true);
    LocalSessionAccessor.prepareUnsafe(repairID, COORDINATOR, PARTICIPANTS);
    SSTableReader sstable = makeSSTable(true);
    mutateRepaired(sstable, repairID);
    csm.handleNotification(new SSTableAddedNotification(Collections.singleton(sstable)), cfs.getTracker());
    Assert.assertTrue(pendingContains(repairID, sstable));
    // delete sstable
    SSTableDeletingNotification notification = new SSTableDeletingNotification(sstable);
    csm.handleNotification(notification, cfs.getTracker());
    Assert.assertFalse(pendingContains(repairID, sstable));
    Assert.assertFalse(unrepairedContains(sstable));
    Assert.assertFalse(repairedContains(sstable));
}
Also used : SSTableReader(org.apache.cassandra.io.sstable.format.SSTableReader) SSTableDeletingNotification(org.apache.cassandra.notifications.SSTableDeletingNotification) SSTableAddedNotification(org.apache.cassandra.notifications.SSTableAddedNotification) UUID(java.util.UUID) Test(org.junit.Test)

Aggregations

UUID (java.util.UUID)1 SSTableReader (org.apache.cassandra.io.sstable.format.SSTableReader)1 SSTableAddedNotification (org.apache.cassandra.notifications.SSTableAddedNotification)1 SSTableDeletingNotification (org.apache.cassandra.notifications.SSTableDeletingNotification)1 Test (org.junit.Test)1