cassandra在压实过程中做了什么?

sam*_*rth 8 immutability cassandra stream-compaction tombstone

我知道cassandra合并sstables,row-keys,删除墓碑等等.

  1. 但我真的很想知道它是如何进行压实的?

  2. 由于sstables是不可变的,它会将所有相关数据复制到新文件中吗?在写入这个新文件时,它会丢弃墓碑标记的数据.

我知道什么是压实,但想知道它是如何实现的(T)

Tam*_*mil 7

我希望这个帖子有所帮助,前提是你跟踪了它中的所有帖子和评论

http://comments.gmane.org/gmane.comp.db.cassandra.user/10577

据我所知

Whenever memtable is flushed from memory to disk they are just appended[Not updated] to new SSTable created, sorted via rowkey.
SSTable merge[updation] will take place only during compaction. 
Till then read path will read from all the SSTable having that key you look up and the result from them is merged to reply back,

Two types : Minor and Major

Minor compaction is triggered automatically whenever a new sstable is being created.
May remove all tombstones
Compacts sstables of equal size in to one [initially memtable flush size] when minor compaction threshold is reached [4 by default]. 

Major Compaction is manually triggered using nodetool
Can be applied over a column family over a time
Compacts all the sstables of a CF in to 1

Compacts the SSTables and marks delete over unneeded SSTables. GC takes care of freeing up that space
Run Code Online (Sandbox Code Playgroud)

此致,泰米尔语