Search code examples
cassandranodetool

How to get the compaction strategy of C* cluster?


In the documentation it says that the SizeTieredCompactionStrategy (STCS) is the default compaction strategy.

How can I get the actual compaction strategy of my cluster?


Solution

  • The compaction strategy is defined on each table

    In cqlsh:

    cqlsh:music> DESCRIBE TABLE artists;
    
    CREATE TABLE music.artists (
        name text PRIMARY KEY,
        born text,
        country text,
        died text,
        gender text,
        styles list<text>,
        type text
    ) WITH bloom_filter_fp_chance = 0.01
        AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
        AND comment = ''
        AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
        ...
        ...;