Sunil Harak
Sunil Harak

Reputation: 249

How to check that compactionn strategy is changed in cassandra?

I'm changing compaction strategy from size to level? Is there any way to check whether the compaction has changed or not??

Upvotes: 0

Views: 430

Answers (2)

Ashraful Islam
Ashraful Islam

Reputation: 12840

You can find compaction info with query :

For Cassandra Version < 3

SELECT compaction_strategy_class,compaction_strategy_options,max_compaction_threshold, min_compaction_threshold FROM system.schema_columnfamilies  WHERE keyspace_name = 'your_keyspace_name' AND columnfamily_name = 'your_table_name';

For Cassandra Version >= 3

SELECT compaction FROM system_schema.tables WHERE keyspace_name = 'your_keyspace_name' AND table_name = 'your_table_name' ;

Upvotes: 0

MD Ruhul Amin
MD Ruhul Amin

Reputation: 4502

Login to cqlsh and check table structure.

$cqlsh> desc keyspacebname.tablename; 

You will see the table compaction class:

CREATE TABLE keyspacebname.tablename (
    .....
    PRIMARY KEY (..)
) WITH CLUSTERING ORDER BY (... DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    ...
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    ....

You can also check the compaction status via nodetool:

$> nodetool  compactionstats

for more details check these links: nodetool compactionstats

Upvotes: 1

Related Questions