DateTieredCompactionStrategy (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.db.compaction

## Class DateTieredCompactionStrategy

- java.lang.Object
- - org.apache.cassandra.db.compaction.AbstractCompactionStrategy
  - - org.apache.cassandra.db.compaction.DateTieredCompactionStrategy

-     public class DateTieredCompactionStrategy
      extends AbstractCompactionStrategy

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.cassandra.db.compaction.AbstractCompactionStrategy

      `AbstractCompactionStrategy.ScannerList`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `estimatedRemainingTasks`

    - ### Fields inherited from class org.apache.cassandra.db.compaction.AbstractCompactionStrategy

      `cfs, COMPACTION_ENABLED, DEFAULT_TOMBSTONE_COMPACTION_INTERVAL, DEFAULT_TOMBSTONE_THRESHOLD, DEFAULT_UNCHECKED_TOMBSTONE_COMPACTION_OPTION, disableTombstoneCompactions, enabled, isActive, TOMBSTONE_COMPACTION_INTERVAL_OPTION, TOMBSTONE_THRESHOLD_OPTION, tombstoneCompactionInterval, tombstoneThreshold, UNCHECKED_TOMBSTONE_COMPACTION_OPTION, uncheckedTombstoneCompaction`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DateTieredCompactionStrategy(ColumnFamilyStore cfs, java.util.Map<java.lang.String,java.lang.String> options)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSSTable(SSTableReader sstable)`
    `static java.util.List<Pair<SSTableReader,java.lang.Long>>` | `createSSTableAndMinTimestampPairs(java.lang.Iterable<SSTableReader> sstables)`
    `int` | `getEstimatedRemainingTasks()`
    `java.util.Collection<AbstractCompactionTask>` | `getMaximalTask(int gcBefore, boolean splitOutput)`
    `long` | `getMaxSSTableBytes()`
    `AbstractCompactionTask` | `getNextBackgroundTask(int gcBefore)`
    `AbstractCompactionTask` | `getUserDefinedTask(java.util.Collection<SSTableReader> sstables, int gcBefore)`
    `java.util.Collection<java.util.Collection<SSTableReader>>` | `groupSSTablesForAntiCompaction(java.util.Collection<SSTableReader> sstablesToGroup)` DTCS should not group sstables for anticompaction - this can mix new and old data
    `void` | `removeSSTable(SSTableReader sstable)`
    `java.lang.String` | `toString()`
    `static java.util.Map<java.lang.String,java.lang.String>` | `validateOptions(java.util.Map<java.lang.String,java.lang.String> options)`

    - ### Methods inherited from class org.apache.cassandra.db.compaction.AbstractCompactionStrategy

      `disable, enable, filterSSTablesForReads, filterSuspectSSTables, getCompactionTask, getMemtableReservedSize, getName, getScanners, getScanners, isAffectedByMeteredFlusher, isEnabled, pause, replaceFlushed, replaceSSTables, resume, shouldBeEnabled, shouldDefragment, shutdown, startup, worthDroppingTombstones`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### estimatedRemainingTasks

          protected volatile int estimatedRemainingTasks

  - ### Constructor Detail

    - #### DateTieredCompactionStrategy

          public DateTieredCompactionStrategy(ColumnFamilyStore cfs,
                                              java.util.Map<java.lang.String,java.lang.String> options)

  - ### Method Detail

    - #### getNextBackgroundTask

          public AbstractCompactionTask getNextBackgroundTask(int 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.

    - #### createSSTableAndMinTimestampPairs

          public static java.util.List<Pair<SSTableReader,java.lang.Long>> createSSTableAndMinTimestampPairs(java.lang.Iterable<SSTableReader> sstables)

      Parameters:
        `sstables` -
      Returns:

    - #### addSSTable

          public void addSSTable(SSTableReader sstable)

      Specified by:
        `addSSTable` in class `AbstractCompactionStrategy`

    - #### removeSSTable

          public void removeSSTable(SSTableReader sstable)

      Specified by:
        `removeSSTable` in class `AbstractCompactionStrategy`

    - #### getMaximalTask

          public java.util.Collection<AbstractCompactionTask> getMaximalTask(int 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,
                                                           int 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.

    - #### getEstimatedRemainingTasks

          public int getEstimatedRemainingTasks()

      Specified by:
        `getEstimatedRemainingTasks` in class `AbstractCompactionStrategy`
      Returns:
        the number of background tasks estimated to still be needed for this columnfamilystore

    - #### getMaxSSTableBytes

          public long getMaxSSTableBytes()

      Specified by:
        `getMaxSSTableBytes` in class `AbstractCompactionStrategy`
      Returns:
        size in bytes of the largest sstables for this strategy

    - #### groupSSTablesForAntiCompaction

          public java.util.Collection<java.util.Collection<SSTableReader>> groupSSTablesForAntiCompaction(java.util.Collection<SSTableReader> sstablesToGroup)

      DTCS should not group sstables for anticompaction - this can mix new and old data
      Overrides:
        `groupSSTablesForAntiCompaction` in class `AbstractCompactionStrategy`

    - #### 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`

Copyright © 2018 The Apache Software Foundation