Class CompactionController

    • Method Detail

      • maybeRefreshOverlaps

        public void maybeRefreshOverlaps()
      • getFullyExpiredSSTables

        public java.util.Set<SSTableReader> getFullyExpiredSSTables()
      • getFullyExpiredSSTables

        public static java.util.Set<SSTableReader> getFullyExpiredSSTables​(ColumnFamilyStore cfStore,
                                                                           java.lang.Iterable<SSTableReader> compacting,
                                                                           java.lang.Iterable<SSTableReader> overlapping,
                                                                           long gcBefore,
                                                                           boolean ignoreOverlaps)
        Finds expired sstables works something like this; 1. find "global" minTimestamp of overlapping sstables, compacting sstables and memtables containing any non-expired data 2. build a list of fully expired candidates 3. check if the candidates to be dropped actually can be dropped (maxTimestamp < global minTimestamp) - if not droppable, remove from candidates 4. return candidates.
        Parameters:
        cfStore -
        compacting - we take the drop-candidates from this set, it is usually the sstables included in the compaction
        overlapping - the sstables that overlap the ones in compacting.
        gcBefore -
        ignoreOverlaps - don't check if data shadows/overlaps any data in other sstables
        Returns:
      • getPurgeEvaluator

        public java.util.function.LongPredicate getPurgeEvaluator​(DecoratedKey key)
        Specified by:
        getPurgeEvaluator in class AbstractCompactionController
        Parameters:
        key -
        Returns:
        a predicate for whether tombstones marked for deletion at the given time for the given partition are purgeable; we calculate this by checking whether the deletion time is less than the min timestamp of all SSTables containing his partition and not participating in the compaction. This means there isn't any data in those sstables that might still need to be suppressed by a tombstone at this timestamp.
      • close

        public void close()
      • ignoreOverlaps

        protected boolean ignoreOverlaps()
        Is overlapped sstables ignored Control whether or not we are taking into account overlapping sstables when looking for fully expired sstables. In order to reduce the amount of work needed, we look for sstables that can be dropped instead of compacted. As a safeguard mechanism, for each time range of data in a sstable, we are checking globally to see if all data of this time range is fully expired before considering to drop the sstable. This strategy can retain for a long time a lot of sstables on disk (see CASSANDRA-13418) so this option control whether or not this check should be ignored. Do NOT call this method in the CompactionController constructor
        Returns:
        false by default