Class TableOptions.CompactionOptions<T extends TableOptions.CompactionOptions>
- java.lang.Object
-
- com.datastax.driver.core.schemabuilder.TableOptions.CompactionOptions<T>
-
- Direct Known Subclasses:
TableOptions.CompactionOptions.DateTieredCompactionStrategyOptions,TableOptions.CompactionOptions.LeveledCompactionStrategyOptions,TableOptions.CompactionOptions.SizeTieredCompactionStrategyOptions,TableOptions.CompactionOptions.TimeWindowCompactionStrategyOptions
- Enclosing class:
- TableOptions<T extends TableOptions>
public abstract static class TableOptions.CompactionOptions<T extends TableOptions.CompactionOptions> extends Object
Compaction options for a CREATE or ALTER TABLE statement.To create instances, use
SchemaBuilder.sizedTieredStategy(),SchemaBuilder.leveledStrategy(),SchemaBuilder.dateTieredStrategy()orSchemaBuilder.timeWindowCompactionStrategy()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTableOptions.CompactionOptions.DateTieredCompactionStrategyOptionsCompaction options specific to the date-tiered strategy.static classTableOptions.CompactionOptions.LeveledCompactionStrategyOptionsCompaction options specific to Leveled strategystatic classTableOptions.CompactionOptions.SizeTieredCompactionStrategyOptionsCompaction options specific to SizeTiered strategystatic classTableOptions.CompactionOptions.StrategyCompaction strategies.static classTableOptions.CompactionOptions.TimeWindowCompactionStrategyOptionsCompaction options specific to the time window strategy.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Stringbuild()Tenabled(Boolean enabled)Enable or disable background compaction.TfreeformOption(String key, Object value)Define a free-form option as a key/value pair.TtombstoneCompactionIntervalInDay(Integer tombstoneCompactionInterval)Define the minimum number of days to wait after an SSTable creation time before considering the SSTable for tombstone compaction.TtombstoneThreshold(Double tombstoneThreshold)Define the ratio of garbage-collectable tombstones to all contained columns, which if exceeded by the SSTable triggers compaction (with no other SSTables) for the purpose of purging the tombstones.TuncheckedTombstoneCompaction(Boolean uncheckedTombstoneCompaction)Enables more aggressive than normal tombstone compactions.
-
-
-
Method Detail
-
enabled
public T enabled(Boolean enabled)
Enable or disable background compaction.If no call is made to this method, the default value set by Cassandra is {code true}.
- Parameters:
enabled- whether to enable background compaction for the table.- Returns:
- this object (for call chaining).
-
tombstoneCompactionIntervalInDay
public T tombstoneCompactionIntervalInDay(Integer tombstoneCompactionInterval)
Define the minimum number of days to wait after an SSTable creation time before considering the SSTable for tombstone compaction. Tombstone compaction is the compaction triggered if the SSTable has more garbage-collectable tombstones than tombstone_threshold.If no call is made to this method, the default value set by Cassandra is 1.
- Parameters:
tombstoneCompactionInterval- the tombstone compaction interval in day.- Returns:
- this object (for call chaining).
-
tombstoneThreshold
public T tombstoneThreshold(Double tombstoneThreshold)
Define the ratio of garbage-collectable tombstones to all contained columns, which if exceeded by the SSTable triggers compaction (with no other SSTables) for the purpose of purging the tombstones.If no call is made to this method, the default value set by Cassandra is 0.2.
- Parameters:
tombstoneThreshold- the threshold.- Returns:
- this object (for call chaining).
-
uncheckedTombstoneCompaction
public T uncheckedTombstoneCompaction(Boolean uncheckedTombstoneCompaction)
Enables more aggressive than normal tombstone compactions. A single SSTable tombstone compaction runs without checking the likelihood of success (Cassandra 2.0.9 and later).If no call is made to this method, the default value set by Cassandra is {code false}.
- Parameters:
uncheckedTombstoneCompaction- whether to enable the feature.- Returns:
- this object (for call chaining).
-
freeformOption
public T freeformOption(String key, Object value)
Define a free-form option as a key/value pair.This method is provided as a fallback if the SchemaBuilder is used with a more recent version of Cassandra that has new, unsupported options.
- Parameters:
key- the name of the option.value- the value of the option. If it's aCharSequence, it will be included in single quotes, otherwise the result of invoking itstoStringmethod will be used unquoted.- Returns:
- this object (for call chaining).
-
build
public abstract String build()
-
-