cassandra 在压缩期间做了什么?

发布于 2024-12-08 02:03:43 字数 203 浏览 1 评论 0原文

我知道 cassandra 合并了 sstables、行键、删除墓碑等等。

  1. 但我真的很想知道它如何执行压缩?

  2. 由于 sstables 是不可变的,它是否会将所有相关数据复制到新文件中?并且在写入这个新文件时,它会丢弃逻辑删除标记的数据。

我知道压缩的作用,但想知道它是如何实现的(T)

I know that cassandra merges sstables, row-keys, remove tombstone and all.

  1. But i am really interested to know how it performs compaction ?

  2. As sstables are immutable does it copy all the relevant data to new file? and while writing to this new file it discard the tombstone marked data.

i know what compaction does but want to know how it make this happen(T)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

哑剧 2024-12-15 02:03:43

我希望这个帖子能有所帮助,前提是您遵循其中的所有帖子和评论

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

问候,
泰米尔语

I hope this thread helps, provided if you follow all the posts and comments in it

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

AFAIK

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

Regards,
Tamil

自我难过 2024-12-15 02:03:43

运行压缩有两种方法:

A-小调压缩。自动运行。
B- 主要压实。手动运行。

在这两种情况下,都会获取 x 个文件(每个 CF)并对其进行处理。在此过程中,将 ttl 过期的行标记为逻辑删除,并删除现有的逻辑删除。这样就生成了一个新文件。本次compaction中生成的tombostones将在下一次compaction中删除(如果度过宽限期,gc_grace)。

A和B之间的区别在于所获取的文件数量和最终文件的数量。
A 取几个相似的文件(相似大小)并生成一个新文件。
B 获取所有文件并仅生成一个大文件。

Are two ways to run compaction :

A- Minor compaction. Run automatically.
B- Major compaction. Run mannualy.

In both cases takes x files (per CF) and process them. In this process mark the rows with expired ttl as tombstones, and delete the existing tombstones. With this generates a new file. The tombostones generated in this compaction, will be delete in the next compaction (if spend the grace period, gc_grace).

The difference between A and B are the quantity of files taken and the final file.
A takes a few similar files (similar size) and generate a new file.
B takes ALL the files and genrate only one big file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文