Search in sources :

Example 1 with SSTableMetadataChanged

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

the class CompactionStrategyManager method handleNotification.

public void handleNotification(INotification notification, Object sender) {
    // we might race with reload adding/removing the sstables, this means that compaction strategies
    // must handle double notifications.
    maybeReloadDiskBoundaries();
    readLock.lock();
    try {
        if (notification instanceof SSTableAddedNotification) {
            SSTableAddedNotification flushedNotification = (SSTableAddedNotification) notification;
            handleFlushNotification(flushedNotification.added);
        } else if (notification instanceof SSTableListChangedNotification) {
            SSTableListChangedNotification listChangedNotification = (SSTableListChangedNotification) notification;
            handleListChangedNotification(listChangedNotification.added, listChangedNotification.removed);
        } else if (notification instanceof SSTableRepairStatusChanged) {
            handleRepairStatusChangedNotification(((SSTableRepairStatusChanged) notification).sstables);
        } else if (notification instanceof SSTableDeletingNotification) {
            handleDeletingNotification(((SSTableDeletingNotification) notification).deleting);
        } else if (notification instanceof SSTableMetadataChanged) {
            SSTableMetadataChanged lcNotification = (SSTableMetadataChanged) notification;
            handleMetadataChangedNotification(lcNotification.sstable, lcNotification.oldMetadata);
        }
    } finally {
        readLock.unlock();
    }
}
Also used : SSTableListChangedNotification(org.apache.cassandra.notifications.SSTableListChangedNotification) SSTableRepairStatusChanged(org.apache.cassandra.notifications.SSTableRepairStatusChanged) SSTableDeletingNotification(org.apache.cassandra.notifications.SSTableDeletingNotification) SSTableAddedNotification(org.apache.cassandra.notifications.SSTableAddedNotification) SSTableMetadataChanged(org.apache.cassandra.notifications.SSTableMetadataChanged)

Aggregations

SSTableAddedNotification (org.apache.cassandra.notifications.SSTableAddedNotification)1 SSTableDeletingNotification (org.apache.cassandra.notifications.SSTableDeletingNotification)1 SSTableListChangedNotification (org.apache.cassandra.notifications.SSTableListChangedNotification)1 SSTableMetadataChanged (org.apache.cassandra.notifications.SSTableMetadataChanged)1 SSTableRepairStatusChanged (org.apache.cassandra.notifications.SSTableRepairStatusChanged)1