Class SizeTieredCompactionStrategy

    • Constructor Detail

      • SizeTieredCompactionStrategy

        public SizeTieredCompactionStrategy​(ColumnFamilyStore cfs,
                                            java.util.Map<java.lang.String,​java.lang.String> options)
    • Method Detail

      • mostInterestingBucket

        public static java.util.List<SSTableReader> mostInterestingBucket​(java.util.List<java.util.List<SSTableReader>> buckets,
                                                                          int minThreshold,
                                                                          int maxThreshold)
        Parameters:
        buckets - list of buckets from which to return the most interesting, where "interesting" is the total hotness for reads
        minThreshold - minimum number of sstables in a bucket to qualify as interesting
        maxThreshold - maximum number of sstables to compact at once (the returned bucket will be trimmed down to this)
        Returns:
        a bucket (list) of sstables to compact
      • getNextBackgroundTask

        public AbstractCompactionTask getNextBackgroundTask​(long gcBefore)
        Specified by:
        getNextBackgroundTask in class AbstractCompactionStrategy
        Parameters:
        gcBefore - throw away tombstones older than this
        Returns:
        the next background/minor compaction task to run; null if nothing to do. Is responsible for marking its sstables as compaction-pending.
      • getMaximalTask

        public java.util.Collection<AbstractCompactionTask> getMaximalTask​(long gcBefore,
                                                                           boolean splitOutput)
        Specified by:
        getMaximalTask in class AbstractCompactionStrategy
        Parameters:
        gcBefore - throw away tombstones older than this
        Returns:
        a compaction task that should be run to compact this columnfamilystore as much as possible. Null if nothing to do. Is responsible for marking its sstables as compaction-pending.
      • getUserDefinedTask

        public AbstractCompactionTask getUserDefinedTask​(java.util.Collection<SSTableReader> sstables,
                                                         long gcBefore)
        Specified by:
        getUserDefinedTask in class AbstractCompactionStrategy
        Parameters:
        sstables - SSTables to compact. Must be marked as compacting.
        gcBefore - throw away tombstones older than this
        Returns:
        a compaction task corresponding to the requested sstables. Will not be null. (Will throw if user requests an invalid compaction.) Is responsible for marking its sstables as compaction-pending.
      • createSSTableAndLengthPairs

        public static java.util.List<Pair<SSTableReader,​java.lang.Long>> createSSTableAndLengthPairs​(java.lang.Iterable<SSTableReader> sstables)
      • getBuckets

        public static <T> java.util.List<java.util.List<T>> getBuckets​(java.util.Collection<Pair<T,​java.lang.Long>> files,
                                                                       double bucketHigh,
                                                                       double bucketLow,
                                                                       long minSSTableSize)
      • getEstimatedCompactionsByTasks

        public static int getEstimatedCompactionsByTasks​(ColumnFamilyStore cfs,
                                                         java.util.List<java.util.List<SSTableReader>> tasks)
      • validateOptions

        public static java.util.Map<java.lang.String,​java.lang.String> validateOptions​(java.util.Map<java.lang.String,​java.lang.String> options)
                                                                                      throws ConfigurationException
        Throws:
        ConfigurationException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object