use of org.apache.cassandra.notifications.SSTableAddedNotification 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));
}
use of org.apache.cassandra.notifications.SSTableAddedNotification in project cassandra by apache.
the class CompactionStrategyManagerPendingRepairTest method getStrategies.
/**
* CompactionStrategyManager.getStrategies should include
* pending repair strategies when appropriate
*/
@Test
public void getStrategies() {
UUID repairID = registerSession(cfs, true, true);
LocalSessionAccessor.prepareUnsafe(repairID, COORDINATOR, PARTICIPANTS);
List<List<AbstractCompactionStrategy>> strategies;
strategies = csm.getStrategies();
Assert.assertEquals(3, strategies.size());
Assert.assertTrue(strategies.get(2).isEmpty());
SSTableReader sstable = makeSSTable(true);
mutateRepaired(sstable, repairID);
csm.handleNotification(new SSTableAddedNotification(Collections.singleton(sstable)), cfs.getTracker());
strategies = csm.getStrategies();
Assert.assertEquals(3, strategies.size());
Assert.assertFalse(strategies.get(2).isEmpty());
}
use of org.apache.cassandra.notifications.SSTableAddedNotification in project eiger by wlloyd.
the class LeveledCompactionStrategy method handleNotification.
public void handleNotification(INotification notification, Object sender) {
if (notification instanceof SSTableAddedNotification) {
SSTableAddedNotification flushedNotification = (SSTableAddedNotification) notification;
manifest.add(flushedNotification.added);
} else if (notification instanceof SSTableListChangedNotification) {
SSTableListChangedNotification listChangedNotification = (SSTableListChangedNotification) notification;
manifest.promote(listChangedNotification.removed, listChangedNotification.added);
}
}
Aggregations